Rails 4 + Capistrano + AWS Net :: SSH :: AuthenticationFailed:deploy

时间:2016-03-26 07:32:41

标签: ruby-on-rails ruby-on-rails-4 amazon-web-services capistrano

我按照this教程使用 capistrano 部署 Rails 4 应用 AWS 并且很难解决这个问题。

当我运行cap production deploy时,它失败并出现以下错误

Net::SSH::AuthenticationFailed: deploy

以下是 完整跟踪

** 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

根据此SO帖子,我尝试在net-ssh2.7.0 net-ssh-gateway处锁定1.2.0,但错误仍然存​​在。任何帮助表示赞赏。

环境:

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

1 个答案:

答案 0 :(得分:-1)

问题出在net-ssh上,正如Sparkmasterflex正确回答的那样,但是这会让capistrano工作正常,它可能会破坏你的应用程序:
这些步骤为我修复了capistrano和rails:

  1. 在你的Gemfile中添加gem'net-ssh','2.7.0'
  2. 运行捆绑包更新net-ssh
  3. 运行捆绑包(只是为了确保一切正常“
  4. 运行gem uninstall net-ssh -v 2.8.0
  5. 如果您是rails用户,您现在应该可以同时运行rails服务器和capistrano。