I am having trouble with my rails environment. Everything works fine
excepts that errors in view code does not show a stacktrace, just the
“We’re sorry, but something went wrong.” page, and the log just shows a
“500 Internal Server Error” line.
I am running in development mode, and errors in controller code show a
stacktrace.
Could someone first confirm that rendering view code like: “<% bogus %>”
should indeed show a stacktrace, and not just an “We’re sorry, but
something went wrong.” page?
I’m using ruby 1.9.3 and theese are my gems installed:
On Monday, 15 October 2012 13:51:42 UTC-4, Ruby-Forum.com User wrote:
Could someone first confirm that rendering view code like: “<% bogus %>”
should indeed show a stacktrace, and not just an “We’re sorry, but
something went wrong.” page?
That’s all you’ll get in production - exposing stack traces to the
public is
generally considered a potential security hole.
For monitoring errors in production, there are a bunch of choices:
Airbrake: airbrake.io
Provides a nice web interface and some tools for aggregating error
reports,
tracking deploys, etc. They’ve got a free plan if you’d like to try it
out.
New Relic: newrelic.com
Primarily focused on measuring application performance, but also tracks
errors.
Also has a free plan to try out.
Could someone first confirm that rendering view code like: “<% bogus %>”
should indeed show a stacktrace, and not just an “We’re sorry, but
something went wrong.” page?
Yes, in development mode you should get a stack trace wherever the
error occurs. Have you touched config/development.rb? If you think
not then post it here. Are you sure you are in development mode? Put
a syntax error in development.rb to check. I think you may have to
restart the server after changing development.rb.
I am running in development mode, and errors in controller code show a
stacktrace.
Could someone first confirm that rendering view code like: “<% bogus %>”
should indeed show a stacktrace, and not just an “We’re sorry, but
something went wrong.” page?
That’s all you’ll get in production - exposing stack traces to the public is
generally considered a potential security hole.
Of course. But this is development, as the OP has been at pains to
explain to us.
I can confirm the same thing in Rails 3.latest, and I posted a full
stack trace from a view error in 3.0.latest. Not sure where the break
point is, I only have 3.0.latest and 3.latest here, perhaps someone with
3.1.latest could test and confirm – only takes a few minutes if you
have the gems.