What happens is that phusion is using the last railsenv it processes
for all the virtual hosts (like setting it globally).
I am using passenger 2.03 on ubuntu and apache 2.2.8
I keep seeing references to the fact that railsenv is supposed to work
on a per virtualhost. The documentation says it's supposed to work on
a per virtualhost basis.
Perhaps there is some other setting that needs to be tweaked in order
to make it work.
In my case I can't use the reboot trick because all sites have to be
up all the time.
Actually that's not the case. In my case they are different app roots
too. One is in /var/www/application and other in
/var/www/application_staging.
So in my case it's two different roots, two different vhosts two
different (supposedly) environments.
BTW I did an ugly hacky workaround with capistrano. Here is what I did.
task :after_update_code, :roles => :app do
run "rm -rf #{release_path}/public/.htaccess"
run %Q( sed -i "s/#SED_ME/RAILS_ENV = 'staging'/"
#{release_path}/config/environment.rb )
end
As you can see I call out to sed to replace the #SED_ME comment with
the RAILS_ENV call.
Is this problem fixed with the new version of phusion? Can we specify
a different rails env for different applications?
RailsEnv per virtual host has been supported since June 2008 with
version 1.9.0.
--
Phusion | The Computer Science Company
Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)