2

I have a rails app. When in production my app is throwing a routing error instead of rendering the 404.html or 500.html. Why would Rails be throwing the error instead of rendering the 404 page? (output from dev with config.consider_all_requests_local = false)

Started GET "/asdfadsfdsaf" for 127.0.0.1 at 2015-03-04 16:51:12 -0500

ActionController::RoutingError (No route matches [GET] "/asdfadsfdsaf"):
 ...
Jake
  • 383
  • 6
  • 26

2 Answers2

4

As long as your app is running, your web server will not generate the 404.

If you want to have routing errors generate a 404, please see the discussion in this article: render a 404 page on routing error in rails.

Community
  • 1
  • 1
rdnewman
  • 1,379
  • 20
  • 28
3

Check your config/environment/*.rb file (correspond to your env). It should contain the following string:

config.consider_all_requests_local = false

Check that this value is set to false. In this case will be rendered 404.html ot 500.html files.

Maxim
  • 9,701
  • 5
  • 60
  • 108