Forum: Ruby on Rails Passenger caching in development mode, wtf?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Petr J. (Guest)
on 2009-04-15 06:24
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
Petr J. (Guest)
on 2009-04-15 07:17
I just tested with Ruby 1.8 and its the same behaviour.

An clues people?
Py J. (Guest)
on 2009-04-15 08:08
perhaps here:

http://www.modrails.com/documentation/Users%20guid...

but can't you use mongrel for development and passenger for production?

Petr J. wrote:
> I just tested with Ruby 1.8 and its the same behaviour.
>
> An clues people?
Petr J. (Guest)
on 2009-04-15 08:58
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.


PP Junty wrote:
> perhaps here:
>
> http://www.modrails.com/documentation/Users%20guid...
>
> but can't you use mongrel for development and passenger for production?
>
> Petr J. wrote:
>> I just tested with Ruby 1.8 and its the same behaviour.
>>
>> An clues people?
Frederick C. (Guest)
on 2009-04-15 12:13
(Received via mailing list)
On Apr 15, 5:58 am, Petr J. <removed_email_address@domain.invalid>
wrote:
> 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
Charles J. (Guest)
on 2009-04-15 18:01
(Received via mailing list)
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

On Wed, Apr 15, 2009 at 3:11 AM, Frederick C. <
Petr J. (Guest)
on 2009-04-16 06:36
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
Frederick C. (Guest)
on 2009-04-16 12:56
(Received via mailing list)
On Apr 16, 3:36 am, Petr J. <removed_email_address@domain.invalid>
wrote:
> 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.
>
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
This topic is locked and can not be replied to.