0

I followed this tutorial to deploy my Rails 4 app using capistrano to AWS and having a hard time solving this issue.

When I run cap production deploy, it fails with the below error

Net::SSH::AuthenticationFailed: deploy

Below is the is full trace

** 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 rvm:hook (first_time)
** Execute rvm:hook
** Invoke rvm:check (first_time)
** Execute rvm:check
DEBUG [2439e1e0] Running ~/.rvm/bin/rvm version on 52.37.242.197
DEBUG [2439e1e0] Command: ~/.rvm/bin/rvm version
cap aborted!
Net::SSH::AuthenticationFailed: deploy
/home/pavan/.rvm/gems/ruby-2.2.3/gems/net-ssh-2.7.0/lib/net/ssh.rb:215:in `start'
/home/pavan/.rvm/gems/ruby-2.2.3/gems/sshkit-1.3.0/lib/sshkit/backends/connection_pool.rb:25:in `create_or_reuse_connection'
/home/pavan/.rvm/gems/ruby-2.2.3/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:173:in `ssh'
/home/pavan/.rvm/gems/ruby-2.2.3/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:126:in `block in _execute'
/home/pavan/.rvm/gems/ruby-2.2.3/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:123:in `tap'
/home/pavan/.rvm/gems/ruby-2.2.3/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:123:in `_execute'
/home/pavan/.rvm/gems/ruby-2.2.3/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:76:in `capture'
/home/pavan/.rvm/gems/ruby-2.2.3/gems/capistrano-rvm-0.1.2/lib/capistrano/tasks/rvm.rake:9:in `block (3 levels) in <top (required)>'
/home/pavan/.rvm/gems/ruby-2.2.3/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/home/pavan/.rvm/gems/ruby-2.2.3/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:54:in `run'
/home/pavan/.rvm/gems/ruby-2.2.3/gems/sshkit-1.3.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Tasks: TOP => rvm:check

According to this SO post I tried locking net-ssh at 2.7.0 and net-ssh-gateway at 1.2.0 but the error still persists. Any help is appreciated.

Environment:

OS - Ubuntu 14.04 LTS

Ruby - 2.2.3p173

Rails - 4.2.5

Capistrano - 3.4.0

net-ssh - 2.7.0

net-ssh-gateway - 1.2.0

Community
  • 1
  • 1
Pavan
  • 33,316
  • 7
  • 50
  • 76

1 Answers1

-1

The issue is with net-ssh as was correctly answered by Sparkmasterflex, however whilst this will get capistrano working ok it may break your rails app:
These steps fixed both capistrano and rails for me:

  1. In your Gemfile add gem 'net-ssh', '2.7.0'
  2. Run bundle update net-ssh
  3. Run bundle (just to be sure everything is working ok'
  4. Run gem uninstall net-ssh -v 2.8.0

If you are a rails user you should now be able to run both the rails server and capistrano.

GitaarLAB
  • 14,536
  • 11
  • 60
  • 80
sarbada
  • 395
  • 1
  • 9