Rails,未找到 favicon.ico [英] Rails, favicon.ico not found

查看:45
本文介绍了Rails,未找到 favicon.ico的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这太奇怪了,我一直收到:

This is soo odd, I've been receiving:

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

但是我的公共目录中有 favicon.ico ......有什么想法可以解决这个问题吗?Nginx 根本不会抛出错误.

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

推荐答案

似乎 nginx 不处理您的静态资产(因为此对静态文件的请求转到 ActionController).检查 nginx 配置文件 nginx.conf 中的公共根.以下是 Capistrano 部署的示例:

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;
}

你是否在头脑中使用了 favicon_link_tag 助手 :) ?

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

这篇关于Rails,未找到 favicon.ico的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆