42

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 Answers 3

86

In config/environments/production.rb

temporally change

  config.consider_all_requests_local       = false

to

  config.consider_all_requests_local       = true
0
6

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.

6
  • The question is "How can turn off "we're sorry" page?"
    – Alexandre
    Commented Jul 22, 2012 at 15:29
  • I've added some information about that, but in the end I think you should check the logs and not spend time configuring your production to match your environment. Commented Jul 22, 2012 at 15:34
  • You cannot turn it off, you can change the error page on your public folder.
    – Lefsler
    Commented Jul 22, 2012 at 15:34
  • @ucas clemente, Yes, it also would be helpful. How do I add stuff to the exception page?
    – Alexandre
    Commented Jul 22, 2012 at 16:45
  • 1
    I am working on a fresh, new app. There's 0 traffic. I am running into a most elusive bug that I would like to debug with web_console gem. But, I can't do that until I can show the actual error on the page - which is the only scene where I see the error message. I do not see it even when I simulate a headless request in the production console in shell. So, I think op's request is understandable Commented Mar 22, 2016 at 3:45
1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.