Passenger caching in development mode, wtf?

Hi all, I updated an application to Rails 2.3.2(and ruby 1.9.1) and installed Passenger, after learning that it turns production mode on by default, i changed that to development mode. Logs are correctly being saved to development.log so i should definately be in development mode, right?

Well NO! Any change to my code has to be followed by a restart of the application due to some caching that I dont want.

Now that they are removing CGI support too, just how the hell am I supposed to be making a website in development mode without having to restart 500 times a day???

Thanks Petr

I just tested with Ruby 1.8 and its the same behaviour.

An clues people?

This makes no difference. The problem is with mongrel is that I need the devel applications to be accessible even when im not developing, ie. client review. And id need to make a start up script in case i reboot the server to make all the mongrels start up. Its just hassle. dispatch.cgi/fcgi was ideal for simple setup in development mode where speed usually doesnt matter.

Well the passenger docs imply that it should all just work:

"If you set RailsEnv development in your Apache configuration, then Rails will automatically reload your application code after each request"

You might want to ask the passenger mailing list or similar why it doesn't seem to be working for you.

Fred

I’ve not tried this, but as a last resort you might try: touch tmp/always_restart.txt in your application’s root folder.

Cheers–

Charles

Ok i resolved it, after hours of trying to figure it out, i noticed that the cause is having config.threadsafe! enabled in development mode. For some reason it causes caching to get enabled. This option should be documented better.

Petr

The reloading mechanism in rails isn't threadsafe, so threadsafe! among other things turns it off (mentioned among other places in http://guides.rubyonrails.org/configuring.html)

Fred