问题:每次我在开发中启动rails服务器并导航到有错误的页面时,我都会得到500错误页面,而不是详细说明特定错误及其可以找到的行的后跟踪页面。
例如:
我导航到http://localhost:3000/articles/new
,然后得到:
500内部服务器错误 Web服务器无法执行此请求。请稍后再试。
我为避免这种情况所做的事情:
(1)在environment / production.rb中注释掉了
#consider_all_requests_local = false
#config.action_controller.perform_caching = true
(2)确保环境/ development.rb
config.consider_all_requests_local = true
日志文件:
开始发布" / articles"在2015-06-19 21:40:19 -0700的127.0.0.1 由ArticlesController处理#create as HTML 参数:{" utf8" =>"✓"," authenticity_token" =>" IiAVgs285sNZMcs32nnE4WQNFCiZJIfEB8kN / 6J7WAc =",&# 34;文章" => {"标题" =>"狗","文字" =>"家"} ,"提交" =>"保存文章"} 在8毫秒内完成500内部服务器错误
ActionView :: MissingTemplate(缺少模板文章/创建,应用/创建{:locale => [:en],:formats => [:html],:handlers => [:erb,:builder ,:raw,:ruby,:jbuilder,:coffee]}。搜索: *" C:/ Users / harry / rails_projects / blog / app / views" ): app / controllers / articles_controller.rb:7:在'create'
中渲染 C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/actionpack-4.0.3/lib/action_dispatch/middleware/templates/rescues/missing_template.erb救援/布局(0.0ms)