39
votes

Rails 3.2.3

In production mode I have an error and it displays standard "we're sorry" page. In development mode there is no error.

I need to get more information about the error so I want to turn off "we're sorry" page and see the error. I know it has to be lauched as "rails s -e production" and I do it at my local computer. But how can turn off "we're sorry" page?

3

3 Answers

80
votes

In config/environments/production.rb

temporally change

  config.consider_all_requests_local       = false

to

  config.consider_all_requests_local       = true
6
votes

Look at the logs in log/production.log. Usually this has to do with assets, maybe you need to put gem 'therubyracer' into the Gemfile.

The error page is displayed by some entries in the rack middleware (i believe ActionDispatch::ShowExceptions and ActionDispatch::DebugExceptions). You could always add them to your application, but probably it's easier to check the logs. "Turning off" the page actually means adding stuff to display the exception page.

1
votes

I always forget setting the environment variable for the SECRET_KEY_BASE. Look at config/secrets.yml.