Codeship - 捆绑包安装错误(您必须将捆绑包 2 或更高版本与此锁定文件一起使用)

Codeship - Bundle install error (You must use bundler 2 or greater with this lockfile)

我正在尝试 运行 使用 Ruby 2.7.0 和 Rails 6.0.2.2 在 Codeship 上进行一些测试。

错误: 当我们尝试推送新更改时,我们会收到一个构建错误,显示 'You must use bundler 2 or greater with this lockfile'.

我尝试过的: 为了对此进行修改,我尝试添加以下行:gem install -v bundler 2.1.4。但是,在将其包含在我的管道中之后,我们遇到了递归锁定错误。

当我 运行 'gem list | grep "bundle"' 我得到以下信息:

bundler (default: 2.1.2, 1.17.1)

我的 Gemfile.lock 看起来像这样:

GEM
  remote: https://rubygems.org/
  specs:
    actioncable (6.0.2.2)
      actionpack (= 6.0.2.2)
      nio4r (~> 2.0)
      websocket-driver (>= 0.6.1)
    actionmailbox (6.0.2.2)
      actionpack (= 6.0.2.2)
      activejob (= 6.0.2.2)
      activerecord (= 6.0.2.2)
      activestorage (= 6.0.2.2)
      activesupport (= 6.0.2.2)
      mail (>= 2.7.1)
    actionmailer (6.0.2.2)
      actionpack (= 6.0.2.2)
      actionview (= 6.0.2.2)
      activejob (= 6.0.2.2)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (6.0.2.2)
      actionview (= 6.0.2.2)
      activesupport (= 6.0.2.2)
      rack (~> 2.0, >= 2.0.8)
      rack-test (>= 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.2.0)
    actiontext (6.0.2.2)
      actionpack (= 6.0.2.2)
      activerecord (= 6.0.2.2)
      activestorage (= 6.0.2.2)
      activesupport (= 6.0.2.2)
      nokogiri (>= 1.8.5)
    actionview (6.0.2.2)
      activesupport (= 6.0.2.2)
      builder (~> 3.1)
      erubi (~> 1.4)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.1, >= 1.2.0)
    activejob (6.0.2.2)
      activesupport (= 6.0.2.2)
      globalid (>= 0.3.6)
    activemodel (6.0.2.2)
      activesupport (= 6.0.2.2)
    activerecord (6.0.2.2)
      activemodel (= 6.0.2.2)
      activesupport (= 6.0.2.2)
    activerecord-import (1.0.4)
      activerecord (>= 3.2)
    activestorage (6.0.2.2)
      actionpack (= 6.0.2.2)
      activejob (= 6.0.2.2)
      activerecord (= 6.0.2.2)
      marcel (~> 0.3.1)
    activesupport (6.0.2.2)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 0.7, < 2)
      minitest (~> 5.1)
      tzinfo (~> 1.1)
      zeitwerk (~> 2.2)
    addressable (2.7.0)
      public_suffix (>= 2.0.2, < 5.0)
    autoprefixer-rails (9.7.6)
      execjs
    awesome_print (1.8.0)
    bcrypt (3.1.13)
    better_errors (2.6.0)
      coderay (>= 1.0.0)
      erubi (>= 1.0.0)
      rack (>= 0.9.0)
    bindex (0.8.1)
    binding_of_caller (0.8.0)
      debug_inspector (>= 0.0.1)
    bootsnap (1.4.6)
      msgpack (~> 1.0)
    bootstrap (4.3.1)
      autoprefixer-rails (>= 9.1.0)
      popper_js (>= 1.14.3, < 2)
      sassc-rails (>= 2.0.0)
    bootstrap-sass (3.4.1)
      autoprefixer-rails (>= 5.2.1)
      sassc (>= 2.0.0)
    bootstrap_form (4.4.0)
      actionpack (>= 5.0)
      activemodel (>= 5.0)
    builder (3.2.4)
    byebug (11.1.2)
    capybara (3.32.1)
      addressable
      mini_mime (>= 0.1.3)
      nokogiri (~> 1.8)
      rack (>= 1.6.0)
      rack-test (>= 0.6.3)
      regexp_parser (~> 1.5)
      xpath (~> 3.2)
    childprocess (3.0.0)
    chronic (0.10.2)
    coderay (1.1.2)
    coffee-rails (5.0.0)
      coffee-script (>= 2.2.0)
      railties (>= 5.2.0)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.12.2)
    concurrent-ruby (1.1.6)
    crass (1.0.6)
    debug_inspector (0.0.3)
    declarative (0.0.10)
    declarative-option (0.1.0)
    digest-crc (0.5.1)
    dotenv (2.7.5)
    dotenv-rails (2.7.5)
      dotenv (= 2.7.5)
      railties (>= 3.2, < 6.1)
    erubi (1.9.0)
    execjs (2.7.0)
    faker (2.11.0)
      i18n (>= 1.6, < 2)
    faraday (1.0.1)
      multipart-post (>= 1.2, < 3)
    ffi (1.12.2)
    font_awesome5_rails (1.1.1)
      railties (>= 4.2)
    geocoder (1.6.2)
    globalid (0.4.2)
      activesupport (>= 4.2.0)
    google-api-client (0.38.0)
      addressable (~> 2.5, >= 2.5.1)
      googleauth (~> 0.9)
      httpclient (>= 2.8.1, < 3.0)
      mini_mime (~> 1.0)
      representable (~> 3.0)
      retriable (>= 2.0, < 4.0)
      signet (~> 0.12)
    google-cloud-core (1.5.0)
      google-cloud-env (~> 1.0)
      google-cloud-errors (~> 1.0)
    google-cloud-env (1.3.1)
      faraday (>= 0.17.3, < 2.0)
    google-cloud-errors (1.0.0)
    google-cloud-storage (1.26.0)
      addressable (~> 2.5)
      digest-crc (~> 0.4)
      google-api-client (~> 0.33)
      google-cloud-core (~> 1.2)
      googleauth (~> 0.9)
      mini_mime (~> 1.0)
    googleauth (0.12.0)
      faraday (>= 0.17.3, < 2.0)
      jwt (>= 1.4, < 3.0)
      memoist (~> 0.16)
      multi_json (~> 1.11)
      os (>= 0.9, < 2.0)
      signet (~> 0.14)
    httpclient (2.8.3)
    i18n (1.8.2)
      concurrent-ruby (~> 1.0)
    jbuilder (2.10.0)
      activesupport (>= 5.0.0)
    jquery-rails (4.3.5)
      rails-dom-testing (>= 1, < 3)
      railties (>= 4.2.0)
      thor (>= 0.14, < 2.0)
    json (2.3.0)
    jwt (2.2.1)
    listen (3.1.5)
      rb-fsevent (~> 0.9, >= 0.9.4)
      rb-inotify (~> 0.9, >= 0.9.7)
      ruby_dep (~> 1.2)
    loofah (2.5.0)
      crass (~> 1.0.2)
      nokogiri (>= 1.5.9)
    mail (2.7.1)
      mini_mime (>= 0.1.1)
    marcel (0.3.3)
      mimemagic (~> 0.3.2)
    memoist (0.16.2)
    method_source (1.0.0)
    mimemagic (0.3.4)
    mini_mime (1.0.2)
    mini_portile2 (2.4.0)
    minitest (5.14.0)
    msgpack (1.3.3)
    multi_json (1.14.1)
    multipart-post (2.1.1)
    nio4r (2.5.2)
    nokogiri (1.10.9)
      mini_portile2 (~> 2.4.0)
    os (1.1.0)
    pg (1.2.3)
    popper_js (1.16.0)
    public_suffix (4.0.4)
    puma (4.3.3)
      nio4r (~> 2.0)
    rack (2.2.2)
    rack-proxy (0.6.5)
      rack
    rack-test (1.1.0)
      rack (>= 1.0, < 3)
    rails (6.0.2.2)
      actioncable (= 6.0.2.2)
      actionmailbox (= 6.0.2.2)
      actionmailer (= 6.0.2.2)
      actionpack (= 6.0.2.2)
      actiontext (= 6.0.2.2)
      actionview (= 6.0.2.2)
      activejob (= 6.0.2.2)
      activemodel (= 6.0.2.2)
      activerecord (= 6.0.2.2)
      activestorage (= 6.0.2.2)
      activesupport (= 6.0.2.2)
      bundler (>= 1.3.0)
      railties (= 6.0.2.2)
      sprockets-rails (>= 2.0.0)
    rails-dom-testing (2.0.3)
      activesupport (>= 4.2.0)
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.3.0)
      loofah (~> 2.3)
    rails_12factor (0.0.3)
      rails_serve_static_assets
      rails_stdout_logging
    rails_serve_static_assets (0.0.5)
    rails_stdout_logging (0.0.5)
    railties (6.0.2.2)
      actionpack (= 6.0.2.2)
      activesupport (= 6.0.2.2)
      method_source
      rake (>= 0.8.7)
      thor (>= 0.20.3, < 2.0)
    rake (13.0.1)
    rb-fsevent (0.10.3)
    rb-inotify (0.10.1)
      ffi (~> 1.0)
    redis (4.1.3)
    regexp_parser (1.7.0)
    representable (3.0.4)
      declarative (< 0.1.0)
      declarative-option (< 0.2.0)
      uber (< 0.2.0)
    retriable (3.1.2)
    ruby_dep (1.5.0)
    rubyzip (2.3.0)
    sass-rails (6.0.0)
      sassc-rails (~> 2.1, >= 2.1.1)
    sassc (2.3.0)
      ffi (~> 1.9)
    sassc-rails (2.1.2)
      railties (>= 4.0.0)
      sassc (>= 2.0)
      sprockets (> 3.0)
      sprockets-rails
      tilt
    selenium-webdriver (3.142.7)
      childprocess (>= 0.5, < 4.0)
      rubyzip (>= 1.2.2)
    signet (0.14.0)
      addressable (~> 2.3)
      faraday (>= 0.17.3, < 2.0)
      jwt (>= 1.5, < 3.0)
      multi_json (~> 1.10)
    simple_form (5.0.2)
      actionpack (>= 5.0)
      activemodel (>= 5.0)
    spring (2.1.0)
    spring-watcher-listen (2.0.1)
      listen (>= 2.7, < 4.0)
      spring (>= 1.2, < 3.0)
    sprockets (4.0.0)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.2.1)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    sqlite3 (1.4.2)
    thor (1.0.1)
    thread_safe (0.3.6)
    tilt (2.0.10)
    turbolinks (5.2.1)
      turbolinks-source (~> 5.2)
    turbolinks-source (5.2.0)
    tzinfo (1.2.7)
      thread_safe (~> 0.1)
    uber (0.1.0)
    uglifier (4.2.0)
      execjs (>= 0.3.0, < 3)
    web-console (4.0.1)
      actionview (>= 6.0.0)
      activemodel (>= 6.0.0)
      bindex (>= 0.4.0)
      railties (>= 6.0.0)
    webdrivers (4.3.0)
      nokogiri (~> 1.6)
      rubyzip (>= 1.3.0)
      selenium-webdriver (>= 3.0, < 4.0)
    webpacker (4.2.2)
      activesupport (>= 4.2)
      rack-proxy (>= 0.6.1)
      railties (>= 4.2)
    websocket-driver (0.7.1)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.4)
    whenever (1.0.0)
      chronic (>= 0.6.3)
    xpath (3.2.0)
      nokogiri (~> 1.8)
    zeitwerk (2.3.0)

PLATFORMS
  ruby

DEPENDENCIES
  activerecord-import
  awesome_print
  bcrypt
  better_errors
  binding_of_caller
  bootsnap (>= 1.4.2)
  bootstrap (~> 4.3.1)
  bootstrap-sass
  bootstrap_form (~> 4.0)
  byebug
  capybara (>= 2.15)
  coffee-rails
  dotenv-rails
  faker
  font_awesome5_rails
  geocoder
  google-cloud-storage (~> 1.8)
  jbuilder (~> 2.7)
  jquery-rails
  json
  listen (>= 3.0.5, < 3.2)
  pg (~> 1.2)
  puma (~> 4.1)
  rails (~> 6.0.2, >= 6.0.2.1)
  rails_12factor
  redis
  sass-rails (>= 6)
  selenium-webdriver
  simple_form
  spring
  spring-watcher-listen (~> 2.0.0)
  sqlite3
  turbolinks (~> 5)
  tzinfo-data
  uglifier
  web-console (>= 3.3.0)
  webdrivers
  webpacker (~> 4.0)
  whenever

RUBY VERSION
   ruby 2.7.0p0

BUNDLED WITH
   2.1.2

新错误:

Exporting Environment
00:00
git clone --branch "codeship-issue" --depth 50 git@github.com:username/myapp.git ~/src/github.com/username/myapp
00:05
cd clone
00:00
git checkout -qf 2a3698ffd722399e5c1ac8b7fa0abbd9722164fa
00:00
No output generated
Preparing Dependency Cache
00:14
Preparing Bionic Build Container
00:12
if [ -f .ruby-version ]; then rvm use $(cat .ruby-version) --install; fi
00:00
gem install bundler -v 2.1.4
00:00
bundle install
00:02
Traceback (most recent call last):
00:02
    12: from /home/rof/.rvm/gems/ruby-2.7.0/bin/ruby_executable_hooks:24:in `<main>'
00:02
    11: from /home/rof/.rvm/gems/ruby-2.7.0/bin/ruby_executable_hooks:24:in `eval'
00:02
    10: from /home/rof/.rvm/gems/ruby-2.7.0/bin/bundle:23:in `<main>'
00:02
     9: from /home/rof/.rvm/rubies/ruby-2.7.0/lib/ruby/site_ruby/2.7.0/rubygems.rb:304:in `activate_bin_path'
00:02
     8: from /home/rof/.rvm/rubies/ruby-2.7.0/lib/ruby/site_ruby/2.7.0/rubygems.rb:304:in `synchronize'
00:02
     7: from /home/rof/.rvm/rubies/ruby-2.7.0/lib/ruby/site_ruby/2.7.0/rubygems.rb:306:in `block in activate_bin_path'
00:02
     6: from /home/rof/.rvm/rubies/ruby-2.7.0/lib/ruby/site_ruby/2.7.0/rubygems.rb:243:in `finish_resolve'
00:02
     5: from /home/rof/.rvm/rubies/ruby-2.7.0/lib/ruby/site_ruby/2.7.0/rubygems/request_set.rb:435:in `resolve_current'
00:02
     4: from /home/rof/.rvm/rubies/ruby-2.7.0/lib/ruby/site_ruby/2.7.0/rubygems/request_set.rb:435:in `new'
00:02
     3: from /home/rof/.rvm/rubies/ruby-2.7.0/lib/ruby/site_ruby/2.7.0/rubygems/resolver/set.rb:24:in `initialize'
00:02
     2: from /home/rof/.rvm/rubies/ruby-2.7.0/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:42:in `require'
00:02
     1: from /home/rof/.rvm/rubies/ruby-2.7.0/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_gem.rb:67:in `gem'
00:02
/home/rof/.rvm/rubies/ruby-2.7.0/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_gem.rb:67:in `synchronize': deadlock; recursive locking (ThreadError)

在 bundle install 工作之前看起来像以下行:

bundle update --system

对我来说gem update --system 工作顺利。但是在那之后我注意到以下警告

Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.4). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.1.4`.

为了解决这个问题,我按照说明添加了 gem install bundler:2.1.4,警告消失了。

参考文献

https://github.com/jekyll/jekyll/issues/7463#issuecomment-451686361

我遇到了同样的问题,bundle update --system 没有解决问题,正如其他人所建议的那样。

在我的环境和测试设置中到处使用 binstubs。例如bin/bundlebin/rails

我怀疑可能存在使用 binstubs 绕过的 PATH 问题。