Last Updated: September 09, 2019
·
1.349K
· 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