سؤال

I am executing the following command:

cap staging assets:precompile

How do I access the variable env in my Capistrano deploy.rb?

where env is equal to 'staging' in this case?

هل كانت مفيدة؟

المحلول

You can use fetch(:stage) or #{stage} in a string for example like this:

  task :sunspot_stop do
      run "cd #{current_path} && bundle exec rake sunspot:solr:stop RAILS_ENV=#{stage}"
  end
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top