Skip to content

Instantly share code, notes, and snippets.

@pierot
Created February 1, 2011 13:48
Show Gist options
  • Select an option

  • Save pierot/805874 to your computer and use it in GitHub Desktop.

Select an option

Save pierot/805874 to your computer and use it in GitHub Desktop.
Capistrano snippet to set Rails.env
set :rails_env, "test"
set :rack_env, rails_env
task :setup_env do
run "RACK_ENV=#{rails_env}"
run "RAILS_ENV=#{rails_env}"
run "echo 'RackEnv #{rails_env}' >> #{File.join(current_path, '.htaccess')}"
run "echo 'RailsEnv #{rails_env}' >> #{File.join(current_path, '.htaccess')}"
end
task :restart, :roles => :app, :except => { :no_release => true } do
deploy.setup_env
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment