Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails - error in production mode

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?

like image 778
Alexandre Avatar asked Jul 22 '12 15:07

Alexandre


2 Answers

In config/environments/production.rb

temporally change

  config.consider_all_requests_local       = false 

to

  config.consider_all_requests_local       = true 
like image 138
Purple Hexagon Avatar answered Oct 08 '22 05:10

Purple Hexagon


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.

like image 35
lucas clemente Avatar answered Oct 08 '22 05:10

lucas clemente