Search code examples
ruby-on-railsrubyroutesactioncontroller

Rails not rendering 404 in production


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"):
 ...

Solution

  • 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.