我正在将我的应用程序从Rails 2.3.14升级到Rails 3.0.1
如果视图中有任何错误,我总是会得到这个错误
Development mode eh? Here is the error - #<ActionView::Template::Error: ActionView::Template::Error>
app/controllers/application_controller.rb:158:in `render_500'这是在application_controller.rb中为render_500编写的代码
def render_500(error)
if Rails.env.production?
render :file => Rails.root.join('public','access_denied.html'), :status => 500
else
raise Exception, I18n.t('str_error')+" - #{error.inspect}"
end
end我现在正在通过编写puts语句来调试代码。
请给我一个解决方案。提前谢谢。
发布于 2013-08-19 22:06:29
好了,应用程序运行正常。Development mode eh? Here is the error是I18n.t('str_error')中的字符串。您只是引发了一个异常,并且没有呈现任何内容,只呈现了这个字符串,所以没有问题。
模板错误可以是很多东西,但更常见的是没有预编译的资产。对此做一点研究,也许这就是问题所在,但请记住,提供的代码正在按预期工作。
https://stackoverflow.com/questions/18313421
复制相似问题