1

一天中有几次,我收到一个页面格式不正确的错误。

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 Mobile 试图抓取该页面。

我们正在使用带有 Nginx/Passenger Web 服务器的 Rails 3.0.7。是否有任何与移动爬虫相关的配置以避免抛出此错误?

4

1 回答 1

-1

This is a known issue: https://github.com/rails/rails/pull/4176

You can fix it with respond_to and respond_with methods in your controller.

于 2012-01-09T10:25:23.267 回答