gpt4 book ai didi

ruby-on-rails - 部署失败,Capistrano 中的包退出状态为 16

转载 作者:行者123 更新时间:2023-12-05 06:45:25 25 4
gpt4 key购买 nike

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

最佳答案

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

  1. $ echo "gem 'pg'">> Gemfile
  2. $ bundle
  3. $ git add Gemfile.lock
  4. $ git commit -m 'Gemfile 更新。';推送
  5. $ cap production deploy #=> bundle exit status: 16

关于ruby-on-rails - 部署失败,Capistrano 中的包退出状态为 16,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23754250/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com