一天中有几次,我收到错误的页面,没有正确的格式。
ActionView::MissingTemplate: Missing template frontpage/index with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml, :slim, :haml], :formats=>["*/*;q=0.6"], :locale=>[:en_GB, :en_GB]} in view paths .....错误环境:
> HTTP_ACCEPT
> "*/*;q=0.6"
> HTTP_ACCEPT_ENCODING
> "gzip,deflate"
> HTTP_CONNECTION
> "Keep-alive" HTTP_FROM "googlebot(at)googlebot.com"
> HTTP_USER_AGENT
> "SAMSUNG-SGH-E250/1.0 Profile/MIDP-2.0
> Configuration/CLDC-1.1 UP.Browser/6.2.3.3.c.1.101 (GUI) MMP/2.0 (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)"每一次,似乎都是GoogleBot手机在试图抓取这个页面。
我们正在使用带有Nginx / Passenger web服务器的Rails 3.0.7。有没有什么与移动爬虫相关的配置来避免抛出这个错误?
发布于 2012-01-09 18:25:23
这是一个已知的问题:https://github.com/rails/rails/pull/4176
您可以在控制器中使用respond_to和respond_with方法来修复它。
https://stackoverflow.com/questions/8786239
复制相似问题