Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I test error pages in rails development environment?

I want to design my 404 page in my Rails 3.0.7 app. If I request a non existing page I get the development output

    Routing Error

    No route matches "/foo"

I tried the following answers in:

How to test 500.html in rails development env?

application_controller:

def local_request?
  false
end

development.rb:

config.consider_all_requests_local = false

development.rb:

config.action_view.debug_rjs = false

and I also started my app with: RAILS_ENV=production rails s RAILS_ENV=production passenger start

None of it worked.I love how rails makes complicated tasks very simple. But it's really frustrating how really simple things turn out tu be overwhelmingly difficult, impossible to debug and you end up hacking on remote servers to work around it..

Has anyone had this problem before?

like image 997
Axel Tetzlaff Avatar asked Sep 29 '11 14:09

Axel Tetzlaff


2 Answers

If your error pages are static you can simply go to http://localhost:3000/404.html, http://localhost:3000/500.html, etc.

like image 84
James Avatar answered Sep 19 '22 23:09

James


Best idea I've come up with so far is to run the server in production mode locally.

rails s -e production

cheers.

like image 40
Nick Res Avatar answered Sep 23 '22 23:09

Nick Res