Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/52.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 谷歌机器人在Rails网站上抛出错误_Ruby On Rails_Google Crawlers - Fatal编程技术网

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]