If I try to enter a url that doesn't exist in my app, I get error
messages such as unknown action or routing error or.... but not my 404
page. How do I set that 404 page will come up?
Also, if I install exception_notification plugin (as in AWDROR page
627), would it still send me an email when a user gets 404 pages?
If I try to enter a url that doesn't exist in my app, I get error
messages such as unknown action or routing error or.... but not my 404
page. How do I set that 404 page will come up?
Also, if I install exception_notification plugin (as in AWDROR page
627), would it still send me an email when a user gets 404 pages?
This should happen automatically if your site is in production mode. In development mode it will report the actual error.
Yes, in production mode you will get the email from exception_notification for 404 pages. And for 500 errors as well like you'd expect.
If I try to enter a url that doesn't exist in my app, I get error
messages such as unknown action or routing error or.... but not my 404
page. How do I set that 404 page will come up?
Philip Hallstrom wrote:
This should happen automatically if your site is in production mode. In
development mode it will report the actual error.
Except... that in my sites in production mode (1.2.6), it doesn't serve
the 404 -- still serves the raw error message.
Doing some googling, and it seems like there's a lot of gymnastics being
suggested for devs to write code to deal with this themselves, Clearly
the framework should be handling this on its own. If it is supposed to
be doing it in production mode, something is broken in my set up.
Make triple quadruple expontentially infinitely sure you’re not running in development mode. Show me the line in config/environment.rb, the one that reads “RAILS_ENV = [something]”.
Whoa... crazy. Checked off the all the logical things (config files), then started on the less-likely candidates and it turns out my VPN connection to the server short circuits everything, and Rails somehow sees my requests from my home system to my server as being local. Disconnect VPN, and I get the expected the 404.html page. Weird.
The VPN has no intentional relationship to the serving of Rails apps at all.
I have a couple handfuls of servers at a data center to which I connect via VPN to manage.
At the time I was seeing Missing Action error messages on public/production sites, I happened to be connected. I was using my dev system to enter the normal public URLs of the sites just as anyone else would have to.
The sites themselves are on OS X 10.5, Rails 1.2.6, Mongrel (via mongrel_cluster started by monit), and the built-in Apache 2.2 using proxy balancer. No changes to the default environment files except for including some custom libs and declaring a few constants in environment.rb.