Capistrano cannot deploy code, because Net::SSH::AuthenticationFailed: Authentication failed
The problem is the gem
net-ssh
The last version (2.8.0) causes this issue. The solution is to uninstall it:
gem uninstall net-ssh -v 2.8.0
and then to add to the Gemfile its previous version:
gem "net-ssh", "~> 2.7.0"
That's it.
I had the same problem while deploying using capistrano Net::SSH::AuthenticationFailed: Authentication failed for user deployer@IP
ssh-copy-id deployer@ip
This will add your keys to server and you can login without password.
After uninstall net-ssh 2.8.0, remove on gemfile.lock, too. It will continuously okay.