Greetings,
I am modifying rubber so I can have the RAILS environment out there running on separate instances for different developers. For instance, I have a RUBBER_ENV=stage1 with servers stage1 and stagedb01
and I have a RUBBER_ENV=stage2 with servers stage2 stagedb02
This should be relatively easy. I created a new entry in rubber.yml:
rails_env: "#{ENV['RAILS_ENV'] || Rubber.env}"
At the command line, I run
(export RAILS_ENV=staging;export RUBBER_ENV=stage2; cap deploy:cold)which I know works because I added a puts statement in the on :load block in deploy.rb:
puts "Starting deploy with RAILS_ENV = #{ENV['RAILS_ENV']}, #{Rubber.config.rails_env} and RUBBER_ENV=#{Rubber.env}"
which correctly displays:
Starting deploy with RAILS_ENV = staging, staging and RUBBER_ENV=stage2However, in all the templates. (database.yml, crontab, etc.) Rubber.config.rails_env (and rubber_env.rails_env for that matter) is nil!
For instance, in passenger-apache-vhost.conf I have
RailsEnv <%= Rubber.config.rails_env || Rubber.env %>
but I don't get staging, I get stage2, meaning I get Rubber.env instead of Rubber.config.rails_env.
what's happening to these variables between the time deploy.rb executes and these templates are filled?
Please help, I've been at this for hours.
Thanks,
Dan