I am running into issues when attempting to use latest bundler (2.1.4) with docker. Even when checking bundler’s version I get errors:
#!/bin/bash -eo pipefail
bundle -v
Traceback (most recent call last):
2: from /usr/local/bin/bundle:23:in `<main>'
1: from /usr/local/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'
/usr/local/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': Could not find 'bundler' (2.1.4) required by your /home/circleci/project/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.1.4`
This is even after I have stripped down my config.yml to almost nothing (bundler version script taken from here:
Nothing seems to work and it looks like everything is installed correctly (ssh-ed onto the container and the bundler gem/corresponding version is definitely there).
Can you reach out to us at support with some links to the failed jobs (unless this is for a public repo in which case feel free to post them here)? It seems like something is going wrong with the environment along the way in your jobs.
I walked through rubygems versions (3.0.3 -> 3.0.4 -> 3.0.5 -> 3.0.6 -> 3.1.0) on the container and as soon as I upgraded to 3.1.0 the problem goes away.
Looking at the diff, there is a fair bit of delta in lib/rubygems.rb surrounding how bundler gets loaded.