Run script/console Remotely with Capistrano
Allows you to execute script/console remotely through Capistrano. Not for use on multi-machine :roles.
1 2 desc "remotely console" 3 task :console, :roles => :app do 4 input = '' 5 run "cd #{current_path} && ./script/console #{ENV['RAILS_ENV']}" do |channel, stream, data| 6 next if data.chomp == input.chomp || data.chomp == '' 7 print data 8 channel.send_data(input = $stdin.gets) if data =~ /^(>|\?)>/ 9 end 10 end