Hi, I would like to set up a “shared hosting”-like rails environment on
a linux (+Apache1.3 +FastCGI +MySQL) machine. As we all know, rails
provides support for different environments.
Now I would like to enable my “users” to switch individual applications
between development and production mode. In theory, all they have to do
is to add “ENV[‘RAILS_ENV’] ||= ‘production’” into their environment.rb.
The problem is, that the production environment caches the rails
application and once you have entered production mode you cannot switch
back without killing the FastCGI processes or restarting the webserver.
I know that its possible because the RailsFCGIHandler has methods called
resart!, restore! and reload! that exactly that but they are private and
I don’t know how to obtain a reference to RailsFCGIHandler from a Rails
ActionController within that application.
I would like to have some kind of reload script or an admin page with
the button: “Reload Application”…
(And no, I can’t just restart the server because its a shared hosting
environment so there are other (non-rail/ruby) applications running on
that same server)