73tpyq
Last Updated: February 25, 2016
·
1.177K
· fcknganimal

Rails console through Capistrano

namespace :rails do
  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