I want to use the same application in two environments (production and
development) on the same server (apache2 with fcgid) in different
(aliased) directories.
Is there a way to specify RAILS_ENV inside my <Directory> directives? I
have the line
DefaultInitEnv RAILS_ENV production
in my httpd.conf but I want one of the directories to be development.
Setting the ENV var directly in environment.rb is not an option because
I update the production server via SVN but need to keep environment.rb
in my repository.
I want to use the same application in two environments (production and
development) on the same server (apache2 with fcgid) in different
(aliased) directories.
Is there a way to specify RAILS_ENV inside my <Directory> directives? I
have the line
DefaultInitEnv RAILS_ENV production
in my httpd.conf but I want one of the directories to be development.
Setting the ENV var directly in environment.rb is not an option because
I update the production server via SVN but need to keep environment.rb
in my repository.
You could make the enviroment.rb more dynamic, i.e. compute the value for
RAILS_ENV from the current path. A hack but all ruby:
RAILS_ENV = case `hostname`.chomp
when "myserver": /myproduction_dir/.match(File.expand_path(RAILS_ROOT)) ? 'production' : 'development
else 'development'
end