I saw this Capistrano: Can I set an environment variable for the whole cap session?
And I am using this to set my variable
set :default_environment, self[:default_environment].
merge('PAYPAL_SANDBOX' => 'true')
I print self[:default_environment]
and I get PAYPAL_SANDBOX
correctly set
However, how could I test if rails server is running with that variable set?, I think is not working, because in another part I have
ENV['PAYPAL_SANDBOX'] ? 'development' : Rails.env
and I am getting into second part of this sentence, I mean is taking Rails.env
instead of development
My solution was like this:
Set global variable
set :my_number, 23
Get global variable
puts "My number is #{fetch(:my_number)}"
I solved it like this:
I created a file inside my server, just to mark it
Inside an initializer
Then,