如何摆脱与favicon.ico相关的路由错误

时间:2012-12-18 17:24:56

标签: ruby-on-rails-3 favicon

有关如何摆脱此错误的任何想法。

在2012-12-18 11:20:59 +0000

开始获取“/favicon.ico”为132.175.48.49
ActionController::RoutingError (No route matches [GET] "/favicon.ico"):
  actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.8) lib/rails/rack/logger.rb:26:in `call_app'
  railties (3.2.8) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.1) lib/rack/runtime.rb:17:in `call'

1 个答案:

答案 0 :(得分:5)

你可能有这样一行(很可能在你的application.html.erb或其他模板中):

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

如果您这样做,只需将其更改为:

<link href="/assets/favicon.ico" rel="shortcut icon" />