0

I'm trying to replicate a bug in development which come from the production environment.

When the bug occurs I should see a 500 server error, but rails is displaying the following page to me, which is not what I want:

the grey rails error page (the error in the image is not the one I'm trying to reproduce, but it shows they error page, which is what I'm talking about here)

How can I turn off this feature from rails so it just display a 500 error that a normal user will see?

And what is this tool/page called? I usually just call it the (red) rails error page. (but in this case it is grey for some reason, I don't know why too. Does anyone know?)

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
Henry Yang
  • 2,283
  • 3
  • 21
  • 38
  • 2
    https://stackoverflow.com/questions/4156490/how-to-test-500-html-in-rails-development-env Is that what you are trying to do? – kuwantum Jan 04 '18 at 03:42
  • The question of the post you linked helped me. I selected the answer for my post (this). The solution is indeed as simple as changing "consider_all_requests_local: true" to "consider_all_requests_local: false" – Henry Yang Jan 04 '18 at 23:43
  • Glad to hear you got it all working :-) – kuwantum Jan 04 '18 at 23:57
  • Thank you, I appreciate the link, learned a lot! – Henry Yang Jan 05 '18 at 00:23

2 Answers2

3

Try to the following

# config/environments/development.rb
config.consider_all_requests_local = false

By default, this value is true because of the need to debug code on development environment that's why, if you change value with false then will show the error page which is designed default.

If you need to generate and design custom then the follow this tutorial.

Hope to help

fool-dev
  • 7,671
  • 9
  • 40
  • 54
0

What about run rails in production environment?

rails server -e production
Giovanni Benussi
  • 3,102
  • 2
  • 28
  • 30
  • I try to use production but got adapter problem so I use my dev DB as my prod DB and that problem go away. Then I try to access the page and I got routing error. Some style sheet seems to be not working. I'm looking for a way to simply turn off that red rails error page and see what a normal user will see. – Henry Yang Jan 04 '18 at 03:56