Rails doesn't log template errors in development mode

流过昼夜 提交于 2019-12-02 16:55:06

问题


My Rails 3.2.9-app does not show any specific error information to me on errors in templates! It doesn't matter if I use haml or erb, I am always getting

"We're sorry, but something went wrong"

In fact, Webrick is in development mode and if there are errors in my models or controllers, I get the full ordinary error screen.

Examples

Example error in my helper-template ("@resource" does not exist, must be "resource"):
-> All I get is this lousy "We are sorry, but something went wrong"
<% @resource.errors.full_messages.each do |msg| %>

Example error in one of my controllers:
resposnd_to do |format|
-> undefined method `resposnd_to' for ...


回答1:


I finally solved this problem!! All in all, I searched for more than 1 year, but now, i finally got the solution:

The problem is to use umlauts or blank spaces in the path of the rails project. If you move your rails project to a path without umlauts or blanks, the error message should be shown properly :-)!

Tested on ubuntu-machine, maybe this is important for this bug. This bug appears in rails 3.2.9, 3.2.13 and 3.2.14 definitely.

(consider_all_requests_local is activated of course, this never was the reason)



来源:https://stackoverflow.com/questions/16624208/rails-doesnt-log-template-errors-in-development-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!