Rails full error page not displaying view errors

I have a view with a name new.html.erbwith the following code:

<%= some_non_existent_thing.imaginary_method %>

Now I see only one page with 500 errors, for example:

500 Internal Server Error
If you are the administrator of this website, read this web application log file and / or web server log file to find out what went wrong.

Should I see a pretty formatted page with some exception information?

I'm not sure that something is missing for me, but I believe that the rails displayed the entire error page in the development environment when something was wrong in the view.

+5
source share
3 answers

, ? , RAILS_ENV=development rails server -e development.

development.rb,

config.consider_all_requests_local = true
+5

-, , , config/environments/development.rb :

config.consider_all_requests_local = true

.

. , . , String#% . % . , debugger . malformed format string.

, , [ ]:

class Logger::SimpleFormatter
  def call(severity, time, progname, msg)
    "%-7s #{msg}\n" % severity
  end
end

:

class Logger::SimpleFormatter
  def call(severity, time, progname, msg)
    severity_prefix = "[#{severity}]".ljust(7)
    "#{severity_prefix} #{msg}\n"
  end
end
0

This happens if the code does not compile, for example, if you have an if statement that has no end.

0
source

All Articles