【问题标题】:The deploy has failed with an bundle exit status 16 in Capistrano部署失败,Capistrano 中的包退出状态为 16
【发布时间】:2014-05-20 08:08:05
【问题描述】:

我尝试使用 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 }

部署.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"]

生产.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

【问题讨论】:

  • 部署后没有bundle命令能用吗?
  • 好的,你确定你的部署用户有使用bundler的权限吗?

标签: ruby-on-rails capistrano


【解决方案1】:

刚刚遇到了类似的问题,在我的情况下,Gemfile 中的 gem 'rb-fsevent' if 'uname' =~ /Darwin/ 行导致了这个错误。将其注释掉后,部署工作正常。

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

【讨论】:

    【解决方案2】:

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

    1. $ echo "gem 'pg'" >> Gemfile
    2. $ 捆绑
    3. $ git add Gemfile.lock
    4. $ git commit -m 'Gemfile 更新。'; git推送
    5. $ cap production deploy #=> 捆绑退出状态:16

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多