2014-04-11 20 views
1

部署导轨应用程式(滑轨-v 3.2.12)通过Capistrano的3Cap中止! RVM:部署过程中检查中断(CAP3)

$ bundle exec cap production deploy --trace 

和面临如下:

** Invoke production (first_time) 
** Execute production 
** Invoke load:defaults (first_time) 
** Execute load:defaults 
** Invoke production (first_time) 
** Invoke bundler:map_bins (first_time) 
** Execute bundler:map_bins 
** Invoke deploy (first_time) 
** Invoke git:deploy (first_time) 
** Execute git:deploy 
** Execute deploy 
** Invoke deploy:starting (first_time) 
** Execute deploy:starting 
** Invoke deploy:check (first_time) 
** Execute deploy:check 
** Invoke git:check (first_time) 
** Invoke git:wrapper (first_time) 
** Execute git:wrapper 
INFO [87d2f4bf] Running /usr/bin/env mkdir -p /tmp/project/ on 111.111.111.111 
DEBUG [87d2f4bf] Command: /usr/bin/env mkdir -p /tmp/project/ 
cap aborted! 
Net::SSH::AuthenticationFailed: user 
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh.rb:215:in `start' 
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.3.0/lib/sshkit/backends/connection_pool.rb:25:in `create_or_reuse_connection' 
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:173:in `ssh' 
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:126:in `block in _execute' 
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:123:in `tap' 
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:123:in `_execute' 
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:66:in `execute' 
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.1.0/lib/capistrano/tasks/git.rake:17:in `block (3 levels) in <top (required)>' 
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:54:in `instance_exec' 
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:54:in `run' 
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.3.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute' 
Tasks: TOP => git:check => git:wrapper 
The deploy has failed with an error: #<Net::SSH::AuthenticationFailed: user> 
** Invoke deploy:failed (first_time) 
** Execute deploy:failed 

Capfile:

require 'capistrano/setup' 
require 'capistrano/deploy' 
#require 'capistrano/rvm' 
require 'capistrano/bundler' 
require 'capistrano/rails' 

注:我评论了'capistrano/rvm'。当它的注释掉我面临着以下的输出:

** Invoke production (first_time) 
** Execute production 
** Invoke load:defaults (first_time) 
** Execute load:defaults 
** Invoke rvm:hook (first_time) 
** Execute rvm:hook 
** Invoke rvm:check (first_time) 
** Execute rvm:check 
DEBUG [7410609e] Running /usr/local/rvm/bin/rvm version on 111.111.111.111 
DEBUG [7410609e] Command: /usr/local/rvm/bin/rvm version 
cap aborted! 
Net::SSH::AuthenticationFailed: user 

所以两个版本结束与错误

这里是我的设置:

deploy.rb

set :repo_url, '[email protected]:user/project.git' 
set :application, 'project' 
application = 'project' 
set :rvm_type, :system 
set :rvm_ruby_version, '2.0.0-p353' 
set :deploy_to, '/var/www/apps/project' 
set :user, 'user' 
set :ssh_options, { 
    #verbose: :debug, 
    user: fetch(:user) 
} 

部署/生产.rb

server '111.111.111.111', user: 'user', roles: %w{web app db}, my_property: :my_value 

set :ssh_options, { 
forward_agent: false, 
} 

那么,发生了什么事?请帮助

+1

你有净:: SSH :: AuthenticationFailed错误:用户,请检查您的访问设置服务器。这可能是错误的用户名或/和密码。 – BuDen

+0

为什么在production.rb中设置ssh_options? –

回答

0

尝试部署/ production.rb给予更具体的设置,如:

set :ssh_options, { 
    user: 'user', 
    keys: [File.join(ENV["HOME"], ".ssh", "deploy_key")], 
    forward_agent: false, 
    paranoid: false, 
    auth_methods: %w(publickey) 
}