Ruby on rails 谷歌机器人在Rails网站上抛出错误
一天中有好几次,我发现错误的页面格式不正确Ruby on rails 谷歌机器人在Rails网站上抛出错误,ruby-on-rails,google-crawlers,Ruby On Rails,Google Crawlers,一天中有好几次,我发现错误的页面格式不正确 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 ..... 错误环境: > HTT
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)"
每次,似乎都是谷歌机器人手机试图抓取该页面
我们将Rails 3.0.7与Nginx/Passenger web服务器一起使用。是否有与移动爬虫相关的配置以避免抛出此错误?这是一个已知问题:
您可以使用控制器中的respond_to和respond_方法修复它 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]