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

**URL:** <https://www.ruby-forum.com/t/restarting-server-all-the-time-in-development-mode-rails-2/124779>\
**Category:** Rails\
**Created:** [January 2, 2008, 4:00pm UTC](https://www.ruby-forum.com/t/restarting-server-all-the-time-in-development-mode-rails-2/124779 "2008-01-02T16:00:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gustav](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/919ad9/32.png) [@gustav](https://www.ruby-forum.com/u/gustav)\
**Post date:** [January 2, 2008, 4:00pm UTC](https://www.ruby-forum.com/t/restarting-server-all-the-time-in-development-mode-rails-2/124779/1 "2008-01-02T16:00:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gustav](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/919ad9/32.png) [@gustav](https://www.ruby-forum.com/u/gustav)\
**Post date:** [January 2, 2008, 5:39pm UTC](https://www.ruby-forum.com/t/restarting-server-all-the-time-in-development-mode-rails-2/124779/2 "2008-01-02T17:39:08Z")

</div>

Gustav S. 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 D. 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.

---

<div class="post-metadata">

**Author:** ![gustav](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/919ad9/32.png) [@gustav](https://www.ruby-forum.com/u/gustav)\
**Post date:** [January 2, 2008, 6:54pm UTC](https://www.ruby-forum.com/t/restarting-server-all-the-time-in-development-mode-rails-2/124779/3 "2008-01-02T18:54:41Z")

</div>

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

On 2 Jan., 16:00, Gustav S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
