Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails, favicon.ico not found

This is soo odd, I've been receiving:

ActionController::RoutingError (No route matches "/favicon.ico")

but I have the favicon.ico in my public directory... any ideas how to solve this? Nginx doesn't throw an error at all.

like image 986
JP Silvashy Avatar asked Apr 22 '11 22:04

JP Silvashy


2 Answers

Run

rake assets:precompile

then set

config.serve_static_assets = true

in config\environments\production.rb file. Then restart your server. But I think rake assets:precompile is not required.

like image 101
Jiemurat Avatar answered Sep 19 '22 09:09

Jiemurat


It seems that nginx doesn't handle your static assets (since this request for static file goes to the ActionController). Check public root in nginx config file nginx.conf. Here is an example with Capistrano deployments:

server {
  listen       80;
  root /var/www/my_project/current/public;
}

And do you use a favicon_link_tag helper in your head :) ?

like image 32
Voldy Avatar answered Sep 17 '22 09:09

Voldy