Favicon does not appear during production even after clearing the cache

We use Ruby-on-Rails 3.1. I put my favicon.ico in a shared folder. Then I included the link in my layout file as follows:

 <link rel="shortcut icon" href="alphaodb.herokuapp.com/favicon.ico" /> 

I also tried

 <%= favicon_link_tag '/favicon.ico'%> 

In Chrome, it appears in development, but not in production.

In Firefox, it is not displayed both in development and in production.

I also cleared the cache. I know that they ask him many times on this site, but still nothing works for me, can anyone help me with this?

+4
source share
3 answers

Is your favicon.ico file valid? Specifically, did you take the PNG image and rename it to favicon.ico ?

ICO is a special format other than PNG and JPG. However, Chrome is smart enough to figure it out and handle it properly. But you can still expect strange behavior in different browsers.

0
source

It's not entirely clear why this worked, but I went into config / initializers / assets.rb and changed

  Rails.application.config.assets.version = '1.0' 

to

  Rails.application.config.assets.version = '1.1' 

and my badge appeared

0
source

This is an old question, but in this situation rake assets:precompile always worth it when something like this doesn't work.

It is also worth mentioning that <%= favicon_link_tag %> creates another environment-based location, local or production.

These two things threw me up.

0
source

Source: https://habr.com/ru/post/1479683/


All Articles