I’m using rails on apache2 with mod_fcgid and I can’t seem to set the
RAILS_ENV properly.
I have dev & production vhosts and would like to set the environment
from within apache rather than globally via fcgid.conf, and I thought
this might work from within the relevant vhost:

DefaultInitEnv RAILS_ENV production

but it seems to do nothing…

Does anyone know the right way to do it?


And yet again, I answered my own question. It works fine, it’s just
setting the environment within apache means that it never gets picked up
by script/console or rake from within the app directory, which is where
I went wrong.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs