部署失败,Capistrano中的捆绑退出状态为16

时间:2014-05-20 08:08:05

标签: ruby-on-rails capistrano

我尝试使用Capistrano,但我总是遇到一些错误。有以下Capfile:

# Load DSL and Setup Up Stages
require 'capistrano/setup'

# Includes default deployment tasks
require 'capistrano/deploy'
require 'capistrano/rvm'
require 'capistrano/bundler'
require 'capistrano/rails'

Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }

deploy.rb:

lock '3.2.1'

set :application, 'superuser_web_app'
set :repo_url, 'git@github.com:some_repo'

set :deploy_to, 'some_path'
set :branch, 'develop'

set :rails_env, 'development'
set :deploy_via, :copy

set :stages, ["production"]

production.rb:

server 'Some IP', user: 'concierge', roles: %w{app web db}

错误日志:

cap aborted!
SSHKit::Command::Failed: bundle exit status: 16
bundle stdout: Nothing written
bundle stderr: Nothing written
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/sshkit-1.4.0/lib/sshkit/command.rb:98:in `exit_status='
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/sshkit-1.4.0/lib/sshkit/backends/netssh.rb:142:in `block (4 levels) in _execute'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:551:in `call'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:551:in `do_request'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:561:in `channel_request'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:221:in `preprocess'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:205:in `process'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `block in loop'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:269:in `wait'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/sshkit-1.4.0/lib/sshkit/backends/netssh.rb:164:in `block (2 levels) in _execute'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:514:in `call'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:514:in `do_open_confirmation'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:545:in `channel_open_confirmation'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:221:in `preprocess'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:205:in `process'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `block in loop'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/sshkit-1.4.0/lib/sshkit/backends/netssh.rb:166:in `block in _execute'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/sshkit-1.4.0/lib/sshkit/backends/netssh.rb:123:in `tap'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/sshkit-1.4.0/lib/sshkit/backends/netssh.rb:123:in `_execute'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/sshkit-1.4.0/lib/sshkit/backends/netssh.rb:66:in `execute'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/capistrano-bundler-1.1.2/lib/capistrano/tasks/bundler.cap:30:in `block (5 levels) in <top (required)>'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/sshkit-1.4.0/lib/sshkit/backends/abstract.rb:89:in `with'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/capistrano-bundler-1.1.2/lib/capistrano/tasks/bundler.cap:22:in `block (4 levels) in <top (required)>'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/sshkit-1.4.0/lib/sshkit/backends/abstract.rb:81:in `within'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/capistrano-bundler-1.1.2/lib/capistrano/tasks/bundler.cap:21:in `block (3 levels) in <top (required)>'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/sshkit-1.4.0/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/sshkit-1.4.0/lib/sshkit/backends/netssh.rb:54:in `run'
/Users/marya/.rvm/gems/ruby-1.9.3-p448/gems/sshkit-1.4.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Tasks: TOP => deploy:updated => bundler:install
(See full trace by running task with --trace)
The deploy has failed with an error: #<SSHKit::Command::Failed: bundle exit status: 16
bundle stdout: Nothing written
bundle stderr: Nothing written

2 个答案:

答案 0 :(得分:0)

刚出现过类似的问题,在我的情况下,Gemfile中的gem 'rb-fsevent' if 'uname' =~ /Darwin/行导致了这个错误。在评论之后,部署工作正常。

group :development, :test do
  gem 'guard-rails'
  gem 'rb-fsevent' if `uname` =~ /Darwin/
end

答案 1 :(得分:0)

在许多情况下,当您的Gemfile与Gemfile.lock不同时会发生这种情况:

  1. $ echo“gem'pg'”&gt;&gt;的Gemfile
  2. $ bundle
  3. $ git add Gemfile.lock
  4. $ git commit -m'Gemfile update。'; git push
  5. $ cap production deploy#=&gt;捆绑退出状态:16