昨晚我在我的网站上收到了一个异常,这是由 agent:googlebot 的请求引起的。
HomeController# (ActionView::MissingTemplate) "Missing template home/index with {:formats=>[:\"\\\"*/*\\\"\"], :locale=>[:en, :en], :handlers=>[:haml, :rjs, :rhtml, :builder, :rxml, :erb]} in view paths \"/disk1/home/slugs/302902_9453ada_84cd/mnt/app/view
我不明白这是什么意思。看起来奇怪的是格式。
有人经历过类似的事情吗?
谢谢。
最佳答案
这通常意味着有人使用了该页面,Google 对其进行了标记,并开始对其进行抓取。缺少模板表明您有一个 GET 请求,该请求通常只响应 xhr 或 js 请求,但 Google 正在发出一个普通的旧 html 请求,而您的 Controller 不知道如何处理它。
通常的 react 是:
1. 处理 html 版本的 Action 。
2. 如果您不希望 googlebot 抓取该网址,请将其添加到您的 robots.txt 文件中。
3. 如果它正在抓取的操作通常是表单提交的目标并且谷歌正在抓取它,请确保在路由中它只响应适当的 http 方法。
关于ruby-on-rails - 由 google bot(或假装是 googlebot 的东西)引起的 Rails 3 上的奇怪异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3843422/