`bundle install` stopped working today in 2.0 using circleci docker image

bundle install stopped working today. The fix we did was to upgrade bundler version to 1.16, cos 1.15 which is available was casing error
/usr/local/bin/bundle:23:in `load': cannot load such file -- /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/exe/bundle (LoadError)
I think it is connected with last circleci/ruby:2.4-node update made today. Can you confirm and fix that?

Here is part of our config.

version: 2
          - image: circleci/ruby:2.4-node
              PGUSER: circleci-tmr-ruby
              MYSQL_URL: mysql2://root@
              RAILS_ENV: test
          - image: circleci/postgres:9.5-alpine
              POSTGRES_USER: circleci-tmr-ruby
              POSTGRES_DB: tmr
              POSTGRES_PASSWORD: ""
          - image: circleci/mysql:latest
          - image: redis:latest
          - checkout
          - type: cache-restore
            name: Restore bundle cache
            key: rails-tmr-bundle-{{ checksum "Gemfile.lock" }}
          - run:
              name: Bundler install
              command: bundle install --path vendor/bundle
          - type: cache-save
            name: Store bundle cache
            key: rails-tmr-bundle-{{ checksum "Gemfile.lock" }}
              - vendor/bundle
          - run:
1 Like

I have exactly the same issue.

I add sudo gem install bundler before bundle install and fix for now :sob:

1 Like

This is an issue with Bundler 1.16.0 that’s packaged with Ruby. On Friday we reverted a prior patch that uninstalled this version and installed 1.15.4. That patch didn’t fully uninstall 1.16.0.

Initial investigations show that it might require rebuilding the image without installing bundler 1.16.0, instead of relying on docker-library/ruby. We’re discussing working with the upstream maintainers to resolve this.

In the mean time, can you try this workaround in your build before using bundler and let us know if it works for you?

    - run: |
        sudo mv /usr/local/lib/ruby/gems/2.4.0/specifications/{default/,}bundler-1.16.0.gemspec
        sudo gem uninstall bundler -a -x
        sudo gem install bundler --version 1.15.4

Note that you’ll have to substitute 2.4.0 for your ruby major version. Do not change the minor version from 0, so you should use 2.3.0, 2.2.0, etc.

1 Like

@Eric Tried with your suggestion and i still get the same error Could not locate Gemfile when it runs bundle install

Hi Hari,

Can you share what version of Ruby, Rubygems and Bundler were installed after you ran these commands? ruby -v && gem -v && bundle -v ?

ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
Bundler version 1.15.4

Since Rubygems is around version 2.7, you may want to try updating that with gem update --system. I’m not sure if this bug is all Bundler or partly Bundler and partly Rubygems.

Didn’t help, nothing changed
bash-3.2$ sudo gem update --system
Latest version already installed. Done.
bash-3.2$`ruby -v && gem -v && bundle -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
Bundler version 1.16.1

It looks like that updated your bundler version. You may want to upgrade beyond Ruby 2.0.0 at this time, since that version has been EOL since February. That should also resolve this Bundler/Rubygems issue.