Skip to content

Instantly share code, notes, and snippets.

@adrianotadao
Forked from benedikt/rails.rb
Last active August 29, 2015 14:16
Show Gist options
  • Save adrianotadao/a2c552671e83d9ed42c2 to your computer and use it in GitHub Desktop.
Save adrianotadao/a2c552671e83d9ed42c2 to your computer and use it in GitHub Desktop.
# encoding: UTF-8
Capistrano::Configuration.instance(:must_exist).load do
namespace :rails do
desc "Open the rails console on one of the remote servers"
task :console, :roles => :app do
hostname = find_servers_for_task(current_task).first
exec "ssh -l #{user} #{hostname} -t 'source ~/.profile && #{current_path}/script/rails c #{rails_env}'"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment