我在网站上启动 Google Crawler 时遇到此错误:
错误信息:
ActionView::MissingTemplate: 缺少模板主页/索引、应用程序/索引与 {:locale=>[:fr], :formats=>["image/*"], :handlers=>[:erb, :builder, :haml ]}。在以下位置搜索:*“/home/custodir/apps/default/releases/32/app/views”*“/home/custodir/apps/default/shared/bundle/ruby/2.0.0/gems/ckeditor-4.0.10 /app/views" * "/home/custodir/apps/default/shared/bundle/ruby/2.0.0/gems/rails_admin-0.4.9/app/views" * "/home/custodir/apps/default/shared /bundle/ruby/2.0.0/gems/kaminari-0.15.1/app/views" * "/home/custodir/apps/default/shared/bundle/ruby/2.0.0/gems/devise-2.1.4/应用程序/视图”
SO研究:
我注意到这 3 个相关问题: ActionView::MissingTemplate -> 我没有使用 HAML
ActionView::MissingTemplate: 缺少模板-> 不相关
Googlebot 收到现有模板的缺失模板错误-> 尝试了 gem“rails_fix_google_bot_accept”没有区别。
更多细节:
Errbit 表示可能的错误: 88.4%
ActionView::MissingTemplate: 缺少模板主页/索引、应用程序/索引与 {:locale=>[:fr], :formats=>["image/*"], :handlers=>[:erb, :builder, :haml ]}。在以下位置搜索:*“/home/custodir/apps/default/releases/30/app/views”*“/home/custodir/apps/default/shared/bundle/ruby/2.0.0/gems/ckeditor-4.0.10 /app/views" * "/home/custodir/apps/default/shared/bundle/ruby/2.0.0/gems/rails_admin-0.4.9/app/views" * "/home/custodir/apps/default/shared /bundle/ruby/2.0.0/gems/kaminari-0.15.1/app/views" * "/home/custodir/apps/default/shared/bundle/ruby/2.0.0/gems/devise-2.1.4/应用程序/视图”
7.4%
ActionView::MissingTemplate: 缺少模板主页/索引、应用程序/索引与 {:locale=>[:fr], :formats=>[:css], :handlers=>[:erb, :builder, :haml]}。在以下位置搜索:*“/home/custodir/apps/default/releases/30/app/views”*“/home/custodir/apps/default/shared/bundle/ruby/2.0.0/gems/ckeditor-4.0.10 /app/views" * "/home/custodir/apps/default/shared/bundle/ruby/2.0.0/gems/rails_admin-0.4.9/app/views" * "/home/custodir/apps/default/shared /bundle/ruby/2.0.0/gems/kaminari-0.15.1/app/views" * "/home/custodir/apps/default/shared/bundle/ruby/2.0.0/gems/devise-2.1.4/应用程序/视图”
2.5%
ActionView::MissingTemplate: 缺少模板主页/索引、应用程序/索引与 {:locale=>[:fr], :formats=>["image/*"], :handlers=>[:erb, :builder, :haml ]}。在以下位置搜索:*“/home/custodir/apps/default/releases/32/app/views”*“/home/custodir/apps/default/shared/bundle/ruby/2.0.0/gems/ckeditor-4.0.10 /app/views" * "/home/custodir/apps/default/shared/bundle/ruby/2.0.0/gems/rails_admin-0.4.9/app/views" * "/home/custodir/apps/default/shared /bundle/ruby/2.0.0/gems/kaminari-0.15.1/app/views" * "/home/custodir/apps/default/shared/bundle/ruby/2.0.0/gems/devise-2.1.4/应用程序/视图”
1.7%
ActionView::MissingTemplate: 缺少模板主页/索引、应用程序/索引与 {:locale=>[:fr], :formats=>["image/*"], :handlers=>[:erb, :builder, :haml ]}。在以下位置搜索:*“/home/custodir/apps/default/releases/24/app/views”*“/home/custodir/apps/default/shared/bundle/ruby/2.0.0/gems/ckeditor-4.0.10 /app/views" * "/home/custodir/apps/default/shared/bundle/ruby/2.0.0/gems/rails_admin-0.4.9/app/views" * "/home/custodir/apps/default/shared /bundle/ruby/2.0.0/gems/kaminari-0.15.1/app/views" * "/home/custodir/apps/default/shared/bundle/ruby/2.0.0/gems/devise-2.1.4/应用程序/视图”
完整回溯: https ://gist.github.com/YOUConsulting/a59e134a98b4d5bc1438
HTTP_ACCEPT:
图像/*
HTTP_USER_AGENT:
Mozilla/5.0 (Windows NT 6.1; rv:6.0) Gecko/20110814 Firefox/6.0 Google favicon
参数:
{“动作”=>“索引”,“控制器”=>“家”}
更新 1:添加 HomeController 索引
def index
@interest_groups = InterestGroup.all.sort_by &:position || [] # Category blocks
@special_interest_groups = SpecialInterestGroup.all || [] # Student block(s)
@hot_jobs = HotJob.all(api_params_for_user) || [] # Hot Jobs
@jobs_for_you = Job.jobs_for_you(api_params_for_user) || [] # Jobs for you
@applications = []
if current_user
@applications = Application.all_for_user_with_token(current_user.token).select{|a| a.visible?} # Applications
@user = current_user
@user.fetch_sap_data!
end
if params[:status] && params[:status] == '404'
@errors = I18n.t("home.errors.error_404")
@errors_long = I18n.t("home.errors.error_404_long")
@errors_extra = I18n.t("home.errors.error_404_extra")
elsif params[:status] && params[:status] == '422'
@errors = I18n.t("home.errors.error_422")
elsif params[:status] && params[:status] == '500'
@errors = I18n.t("home.errors.error_500")
end
end