Cap中止了SSHKit错误

时间:2014-08-08 05:15:10

标签: ruby-on-rails capistrano digital-ocean sshkit

我正在尝试使用capistrano部署我的rails应用程序,并在命令后收到以下错误:

cap production deploy

输出:

DEBUG[a3e9636c] Running /usr/bin/env [ -d ~/.rvm ] on handco-op.com
DEBUG[a3e9636c] Command: [ -d ~/.rvm ]
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host appname.com: Authentication failed for user deploy@appname.com
/home/deploy/.rvm/gems/ruby-2.1.2/gems/net-ssh-2.9.1/lib/net/ssh.rb:219:in `start'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/connection_pool.rb:50:in `call'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/connection_pool.rb:50:in `create_new_entry'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/connection_pool.rb:22:in `checkout'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:179:in `with_ssh'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:131:in `block in _execute'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:128:in `tap'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:128:in `_execute'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:62:in `test'
/home/deploy/.rvm/gems/ruby-2.1.2/bundler/gems/rvm-dc35ec5e7a74/lib/capistrano/tasks/rvm.rake:19:in `block (3 levels) in <top (required)>'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `run'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
Net::SSH::AuthenticationFailed: Authentication failed for user deploy@appname.com
/home/deploy/.rvm/gems/ruby-2.1.2/gems/net-ssh-2.9.1/lib/net/ssh.rb:219:in `start'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/connection_pool.rb:50:in `call'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/connection_pool.rb:50:in `create_new_entry'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/connection_pool.rb:22:in `checkout'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:179:in `with_ssh'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:131:in `block in _execute'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:128:in `tap'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:128:in `_execute'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:62:in `test'
/home/deploy/.rvm/gems/ruby-2.1.2/bundler/gems/rvm-dc35ec5e7a74/lib/capistrano/tasks/rvm.rake:19:in `block (3 levels) in <top (required)>'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `run'
/home/deploy/.rvm/gems/ruby-2.1.2/gems/sshkit-1.5.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
Tasks: TOP => rvm:hook
(See full trace by running task with --trace)

为了清楚起见,我用&#34; appname&#34;替换了我的真实服务器名称。保守秘密;)感谢您的任何建议!我希望这是一个简单的修复,我也会继续查看错误。

1 个答案:

答案 0 :(得分:0)

我错过了密钥,不得不设置nopassword ssh和许多其他调整。这是一个很难修复的错误,需要很多东西才能解决。大约需要三个小时的调试和修复我的权限。设置这个的一些教程实际上可能会搞乱,例如在sudo组中设置用户确实很难直接定义用户:visudo我建议不要通过以下方式向sudo组添加任何内容:

sudo adduser user sudo

这只是我的设置,因此您可能需要将用户添加到sudo,但我更喜欢在visudo中为我的用户提供所有权限:

visudo

user ALL = NOPASSWD:

希望有人能够解决这个问题!在配置capistrano时,很多事情都是很难解决的,而且主要是我的用户错误。祝好运!保持冷静和代码!;)