2013-08-19 90 views
0

我從提升的Rails我的應用程序2.3.14到Rails 3.0.1的Rails 3 ::的ActionView ::模板錯誤:::的ActionView ::模板錯誤

我總是得到這個錯誤,如果有任何錯誤視圖

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

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 

爲render_500寫我被寫作現在調試代碼的代碼把語句。

請幫我解決。提前致謝。

回答

1

那麼,應用程序運行正常。 Development mode eh? Here is the errorI18n.t('str_error')中的字符串。你只是引發一個異常,並沒有渲染任何東西,只是這個字符串,所以沒有問題。
模板錯誤可能是很多事情,但更常見的是沒有預編譯和東西的資產。對此做一點研究,也許這是問題,但請記住,提供的代碼是按預期工作的。

相關問題