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?

Femaref
  • 60,705
  • 7
  • 138
  • 176
Alexandre
  • 13,030
  • 35
  • 114
  • 173

3 Answers3

86

In config/environments/production.rb

temporally change

  config.consider_all_requests_local       = false

to

  config.consider_all_requests_local       = true
Purple Hexagon
  • 3,538
  • 2
  • 24
  • 45
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.

lucas clemente
  • 6,255
  • 8
  • 41
  • 61
  • The question is "How can turn off "we're sorry" page?" – Alexandre Jul 22 '12 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. – lucas clemente Jul 22 '12 at 15:34
  • You cannot turn it off, you can change the error page on your public folder. – Lefsler Jul 22 '12 at 15:34
  • @ucas clemente, Yes, it also would be helpful. How do I add stuff to the exception page? – Alexandre Jul 22 '12 at 16:45
  • For Future reference it would make more sense for anyone check logs as per this answer. i assumed with my answer to the above there was a very good reason to not. – Purple Hexagon Jan 27 '16 at 22:43
  • 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 – singularity Mar 22 '16 at 03:45
1

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

Tails
  • 636
  • 7
  • 16