Capistrano 部署失败。找不到您的 /root/my_app.com/releases/20210216184029/Gemfile.lock 所需的“捆绑程序”(1.17.2)

时间:2021-02-16 19:11:47

标签: ruby-on-rails ruby capistrano bundler

我第一次尝试设置 debian 服务器(使用 puma、nginx、postgres sql 和 debian 10,来自托管商的 vps)
我使用 capistrano,我准备了一切,但是当我使 bundle exec cap production deploy 失败时,我的终端中有以下答案:


 DEBUG [fe423141]       /usr/local/rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/rubygems.rb:281:in `find_spec_for_exe'

 DEBUG [fe423141]       : 

 DEBUG [fe423141]       Could not find 'bundler' (1.17.2) required by your /root/my_app.com/releases/20210216184029/Gemfile.lock.

 DEBUG [fe423141]        (

 DEBUG [fe423141]       Gem::GemNotFoundException

 DEBUG [fe423141]       )

 DEBUG [fe423141] 

 DEBUG [fe423141]       To update to the latest version installed on your system, run `bundle update --bundler`.

To install the missing version, run `gem install bundler:1.17.2`

 DEBUG [fe423141]               from /usr/local/rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/rubygems.rb:300:in `activate_bin_path'

 DEBUG [fe423141]               from /usr/local/rvm/gems/ruby-3.0.0/bin/bundle:23:in `<main>'

我通过 ssh 访问我的服务器、我的应用程序文件和最后一个版本,我尝试安装 gem 捆绑器并进行捆绑更新。它似乎有效(但如果我在服务器的其他部分这样做,它就不起作用)。

root@my_app:~/my_app.com/releases/20210216183634# bundle update --bundlerThe git source `git://github.com/activeadmin/activeadmin.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
The git source `git://github.com/activeadmin/inherited_resources.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
Your Gemfile lists the gem hashie-forbidden_attributes (>= 0) more than once.
You should probably keep only one of them.
Remove any duplicate entries and specify the gem only once (per group).
While it's not a problem now, it could cause errors if you change the version of one of them later.
Using rake 12.3.3
Using concurrent-ruby 1.1.5
Using i18n 1.6.0
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using zeitwerk 2.1.10
Using activesupport 6.0.0
Using builder 3.2.3
Using erubi 1.8.0
Using mini_portile2 2.4.0
Using nokogiri 1.10.4
Using rails-dom-testing 2.0.3
Using crass 1.0.4
Using loofah 2.2.3
Using rails-html-sanitizer 1.2.0
Using actionview 6.0.0
Using rack 2.0.7
Using rack-test 1.1.0
Using actionpack 6.0.0
Using nio4r 2.5.1
Using websocket-extensions 0.1.4
Using websocket-driver 0.7.1
Using actioncable 6.0.0
Using globalid 0.4.2
Using activejob 6.0.0
Using activemodel 6.0.0
Using activerecord 6.0.0
Using mimemagic 0.3.3
Using marcel 0.3.3
Using activestorage 6.0.0
Using mini_mime 1.0.2
Using mail 2.7.1
Using actionmailbox 6.0.0
Using actionmailer 6.0.0
Using actiontext 6.0.0
Using arbre 1.2.1
Using formtastic 3.1.5
Using formtastic_i18n 0.6.0
Using has_scope 0.7.2
Using method_source 0.9.2
Using thor 0.20.3
Using railties 6.0.0
Using responders 3.0.0
Using inherited_resources 1.11.0 from git://github.com/activeadmin/inherited_resources.git (at master@47acbb1)
Using jquery-rails 4.3.5
Using kaminari-core 1.1.1
Using kaminari-actionview 1.1.1
Using kaminari-activerecord 1.1.1
Using kaminari 1.1.1
Using polyamorous 2.3.0
Using ransack 2.3.0
Using ffi 1.11.1
Using sassc 2.2.0
Using sprockets 3.7.2
Using sprockets-rails 3.2.1
Using tilt 2.0.9
Using sassc-rails 2.1.2
Using babel-source 5.8.35
Using execjs 2.7.0
Using babel-transpiler 0.7.0
Using sprockets-es6 0.9.2
Using activeadmin 2.3.1 from git://github.com/activeadmin/activeadmin.git (at master@a496b8c)
Using autoprefixer-rails 9.6.1.1
Using aws_cf_signer 0.1.3
Using bcrypt 3.1.13
Using bindex 0.8.1
Using msgpack 1.3.1
Using bootsnap 1.4.5
Using bundler 1.17.3
Using byebug 11.0.1
Using mime-types-data 3.2019.0904
Using mime-types 3.3
Using carrierwave 1.3.1
Using http-accept 1.7.0
Using unf_ext 0.0.7.6
Using unf 0.1.4
Using domain_name 0.5.20190701
Using http-cookie 1.0.3
Using netrc 0.11.0
Using rest-client 2.1.0
Using cloudinary 1.9.1
Using coderay 1.1.2
Using orm_adapter 0.5.0
Using warden 1.2.8
Using devise 4.7.1
Using dotenv 2.7.5
Using dotenv-rails 2.7.5
Using dry-core 0.4.9
Using dry-equalizer 0.3.0
Using dry-configurable 0.11.6
Using dry-container 0.7.2
Using dry-inflector 0.2.0
Using dry-logic 1.0.6
Using dry-types 1.4.0
Using font-awesome-sass 5.6.1
Using multi_json 1.15.0
Using request_store 1.5.0
Using gon 6.4.0
Using ruby2_keywords 0.0.2
Using mustermann 1.1.1
Using mustermann-grape 1.0.1
Using rack-accept 0.4.5
Using grape 1.4.0
Using grape-entity 0.8.1
Using rails 6.0.0
Using grape_on_rails_routes 0.3.2
Using hashie 4.1.0
Using hashie-forbidden_attributes 0.1.1
Using jbuilder 2.9.1
Using rb-fsevent 0.10.3
Using rb-inotify 0.10.0
Using listen 3.0.8
Using money 6.13.4
Using monetize 1.9.2
Using money-rails 1.13.2
Using pg 0.21.0
Using pry 0.12.2
Using pry-byebug 3.7.0
Using pry-rails 0.3.9
Using puma 4.1.0
Using rack-proxy 0.6.5
Using redis 4.1.2
Using simple_form 4.1.0
Using spring 2.1.0
Using spring-watcher-listen 2.0.1
Using stripe 5.2.0
Using stripe_event 2.3.0
Using uglifier 4.1.20
Using web-console 4.0.1
Using webpacker 4.0.7
Bundle updated! 

但是 bundle exec cap production deploy 仍然因为同样的原因失败

我的 deploy.rb 是这样的

# config valid for current version and patch releases of Capistrano
lock "~> 3.15.0"

set :application, "my_app.com"
set :repo_url, "git@github.com:my_pseudo/my_app.com.git"

# Default branch is :master
# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp

# Default deploy_to directory is /var/www/my_app_name
set :deploy_to, "/root/my_app.com"

# Default value for :format is :airbrussh.
# set :format, :airbrussh

# You can configure the Airbrussh format using :format_options.
# These are the defaults.
# set :format_options, command_output: true, log_file: "log/capistrano.log", color: :auto, truncate: :auto

# Default value for :pty is false
# set :pty, true

# Default value for :linked_files is []
 append :linked_files, "config/database.yml", 'config/secrets.yml'

# Default value for linked_dirs is []
append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets"

set :nginx_config_name, 'my_app_com'
set :nginx_server_name, 'my_app.com'
set :puma_workers, 1

# Default value for default_env is {}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }

# Default value for local_user is ENV['USER']
# set :local_user, -> { `git config user.name`.chomp }

# Default value for keep_releases is 5
# set :keep_releases, 5

# Uncomment the following to require manually verifying the host key before first deploy.
# set :ssh_options, verify_host_key: :secure

我的宝石文件:

source 'https://rubygems.org'
ruby '2.6.3'

gem 'bootsnap', require: false
gem 'devise'
gem 'ed25519'
gem 'bcrypt_pbkdf'
gem 'jbuilder', '~> 2.0'
gem 'pg', '~> 0.21'
gem 'puma'
gem 'rails', '6.0.0'
gem 'redis'
gem 'grape'
gem 'gon'
gem 'cookies_eu'
gem 'grape-entity'
gem 'grape_on_rails_routes'
gem 'hashie-forbidden_attributes'

gem 'autoprefixer-rails'
gem 'font-awesome-sass', '~> 5.6.1'
gem 'sassc-rails'
gem 'simple_form'
gem 'uglifier'
gem 'webpacker'
gem 'kaminari'   #gem qui permet de gerer un affichage sur plusieurs pages d'une liste
gem 'cloudinary', '~> 1.9.1' #pour uploader et retoucher simplement des photos
gem 'carrierwave', '~> 1.2' # c'est la gem qui associe une photo ou un fichier uploadé a un modéle
gem 'activeadmin', github: 'activeadmin/activeadmin'
gem 'inherited_resources', github: 'activeadmin/inherited_resources'
gem 'money-rails'
gem 'stripe'
gem 'stripe_event'
gem 'hashie-forbidden_attributes'

group :development do
  gem 'web-console', '>= 3.3.0'
  gem 'capistrano'
  gem 'capistrano-rails'
  gem 'capistrano-rvm'
  gem 'capistrano-bundler', require: false
  gem 'capistrano3-puma', github: "seuros/capistrano-puma"


end

group :development, :test do
  gem 'pry-byebug'
  gem 'rspec-rails', '~> 4.0.2'
  gem 'pry-rails'
  gem 'listen', '~> 3.0.5'
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
  gem 'dotenv-rails'

end

部署的主要部分似乎已经成功,但最终bundler:config 失败了。

我迷路了,因为错误消息要求我做一些非常精确的事情,但它似乎不起作用。如果你有一个解决方案的想法,或者可以尝试的东西,甚至可以阅读它,这会对我有很大帮助。

非常感谢

0 个答案:

没有答案