Restarting server all the time in development mode (Rails 2)

Hi, It seems like I have to restart the server for any additions of controllers, models etc. to have any effect since upgrading to Rails 2.0, otherwise I get a routing error. Anyone know how to fix this, and why this is?

Many thanks, Gustav

Gustav Stockholm wrote:

Hi, It seems like I have to restart the server for any additions of controllers, models etc. to have any effect since upgrading to Rails 2.0, otherwise I get a routing error. Anyone know how to fix this, and why this is?

Many thanks, Gustav

I was wondering the same thing, but I think I may have figured it out. I just noticed in the "Agile Web Development with Rails v2" book that it says:

"It turns out that the WEBrick-based Rails dispatcher is pretty clever. In development mode (as opposed to testing or production), it automatically reloads application source files when a new request comes along."

But isn't the default server now Mongrel? Maybe Mongrel doesn't work like that, so it requires a restart each time. You could use 'script/server webrick' to force WEBrick instead of Mongrel, or just deal with restarting.

Did you check:

- if you're running the correct environment?   (running script/server says something like "running in development mode" after starting up) - if you made any changes to config/environments/development.rb?   These lines should be present:     config.cache_classes = false     config.action_controller.consider_all_requests_local = true     config.action_controller.perform_caching = false     config.action_view.cache_template_extensions = false