Skip to content

Instantly share code, notes, and snippets.

@ashleyconnor
Forked from benedikt/rails.rb
Created January 6, 2013 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashleyconnor/4470029 to your computer and use it in GitHub Desktop.
Save ashleyconnor/4470029 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