【发布时间】:2012-01-09 09:28:19
【问题描述】:
一天中有几次,我收到页面格式不正确的错误。
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。有没有什么移动爬虫相关的配置可以避免抛出这个错误?
【问题讨论】:
-
您为 i18n 环境设置的语言环境是哪种方式?
-
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '*', '.{rb,yml}' )] config.i18n.default_locale = :en_GB config.i18n.available_locales = [ :en_GB, :nb_NO ]
标签: ruby-on-rails google-crawlers