通过 Capistrano 3 部署 Rails 应用程序(Rails -v 3.2.12)
$ 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
帽文件:
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
所以两个版本都以错误告终
这是我的设置:
部署.rb
set :repo_url, 'git@bitbucket.org: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,
}
发生什么了?请帮忙