Created
June 16, 2012 00:49
-
-
Save phil-monroe/2939400 to your computer and use it in GitHub Desktop.
Capistrano task to remotely connect to rails console
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based off of https://gist.github.com/1115513 | |
desc "Remote console on the production appserver" | |
task :console, :roles => ENV['ROLE'] || :web do | |
hostname = find_servers_for_task(current_task).first | |
puts "Connecting to #{hostname}" | |
exec "ssh -l #{user} #{hostname} -t 'source ~/.profile && cd #{current_path} && bundle exec rails c #{rails_env}'" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment