title: SSHKit::Runner::ExecuteError: Exception while executing on host
body: <p>Trying to deploy a rails application to digital ocean following this tutorial:</p>
  
  <p><a href="https://www.digitalocean.com/community/tutorials/deploying-a-rails-app-on-ubuntu-14-04-with-capistrano-nginx-and-puma" rel="nofollow">https://www.digitalocean.com/community/tutorials/deploying-a-rails-app-on-ubuntu-14-04-with-capistrano-nginx-and-puma</a></p>
  
  <p>but keep getting an error: 
  cap aborted!
  SSHKit::Runner::ExecuteError: Exception while executing on host xxx.xx.xx.xx: connection closed by remote host. Need help have been at this for the past four hours </p>
  
  <pre><code>&gt;&gt; cap production deploy:initial --trace  
  
  
  
      1 ↵
  ** Invoke production (first_time)
  ** Execute production
  ** Invoke load:defaults (first_time)
  ** Execute load:defaults
  ** Invoke bundler:map_bins (first_time)
  ** Execute bundler:map_bins
  ** Invoke deploy:set_rails_env (first_time)
  ** Execute deploy:set_rails_env
  ** Invoke deploy:set_rails_env
  ** Invoke rvm:hook (first_time)
  ** Execute rvm:hook
  DEBUG [5976e045] Running /usr/bin/env [ -d ~/.rvm ] on xxx.xx.xx.xxx
  DEBUG [5976e045] Command: [ -d ~/.rvm ]
  cap aborted!
  SSHKit::Runner::ExecuteError: Exception while executing on host xxx.xx.xx.xx: connection closed by remote host
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:16:in `rescue in block (2 levels) in execute'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
  Net::SSH::Disconnect: connection closed by remote host
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/server_version.rb:50:in `rescue in block (2 levels) in negotiate!'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/server_version.rb:46:in `block (2 levels) in negotiate!'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/server_version.rb:45:in `loop'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/server_version.rb:45:in `block in negotiate!'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/server_version.rb:43:in `loop'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/server_version.rb:43:in `negotiate!'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/server_version.rb:32:in `initialize'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/session.rb:84:in `new'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/session.rb:84:in `block in initialize'
  /Users/andela/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/timeout.rb:74:in `timeout'
  /Users/andela/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/timeout.rb:125:in `timeout'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/session.rb:84:in `initialize'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh.rb:207:in `new'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh.rb:207:in `start'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/backends/connection_pool.rb:50:in `call'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/backends/connection_pool.rb:50:in `create_new_entry'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/backends/connection_pool.rb:22:in `checkout'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:187:in `with_ssh'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:137:in `block in _execute'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:133:in `tap'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:133:in `_execute'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:62:in `test'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/capistrano-rvm-0.1.2/lib/capistrano/tasks/rvm.rake:21:in `block (3 levels) in &lt;top (required)&gt;'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:54:in `run'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
  EOFError: end of file reached
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/server_version.rb:47:in `readpartial'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/server_version.rb:47:in `block (2 levels) in negotiate!'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/server_version.rb:45:in `loop'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/server_version.rb:45:in `block in negotiate!'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/server_version.rb:43:in `loop'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/server_version.rb:43:in `negotiate!'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/server_version.rb:32:in `initialize'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/session.rb:84:in `new'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/session.rb:84:in `block in initialize'
  /Users/andela/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/timeout.rb:74:in `timeout'
  /Users/andela/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/timeout.rb:125:in `timeout'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/session.rb:84:in `initialize'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh.rb:207:in `new'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh.rb:207:in `start'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/backends/connection_pool.rb:50:in `call'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/backends/connection_pool.rb:50:in `create_new_entry'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/backends/connection_pool.rb:22:in `checkout'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:187:in `with_ssh'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:137:in `block in _execute'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:133:in `tap'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:133:in `_execute'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:62:in `test'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/capistrano-rvm-0.1.2/lib/capistrano/tasks/rvm.rake:21:in `block (3 levels) in &lt;top (required)&gt;'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:54:in `run'
  /Users/andela/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
  Tasks: TOP =&gt; rvm:hook
  </code></pre>