Error installing gem gem-wrappers, rubygems-bundler, rvm on Ruby v2.6.3 (Trusty)

There seems to be a problem importing the global gemset on Ruby 2.6.3 on Trusty. See this build for more details. I think the relevant log output is as follows:

$ rvm use 2.6.3 --install --binary --fuzzy
curl: (22) The requested URL returned error: 404 Not Found
Required ruby-2.6.3 is not installed - installing.
curl: (22) The requested URL returned error: 404 Not Found
Searching for binary rubies, this might take some time.
Found remote file https://rubies.travis-ci.org/ubuntu/14.04/x86_64/ruby-2.6.3.tar.bz2
Checking requirements for ubuntu.
Requirements installation successful.
ruby-2.6.3 - #configure
ruby-2.6.3 - #download
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 15.3M  100 15.3M    0     0   975k      0  0:00:16  0:00:16 --:--:-- 1538k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.6.3 - #validate archive
ruby-2.6.3 - #extract
ruby-2.6.3 - #validate binary
ruby-2.6.3 - #setup
ruby-2.6.3 - #gemset created /home/travis/.rvm/gems/ruby-2.6.3@global
ruby-2.6.3 - #importing gemset /home/travis/.rvm/gemsets/global.gems
there was an error installing gem gem-wrappers
there was an error installing gem rubygems-bundler
there was an error installing gem rvm
.........................................................
ruby-2.6.3 - #generating global wrappers..............
Error running 'run_gem_wrappers_regenerate',
please read /home/travis/.rvm/log/1560965486_ruby-2.6.3/gemset.wrappers.global.log
ruby-2.6.3 - #gemset created /home/travis/.rvm/gems/ruby-2.6.3
ruby-2.6.3 - #importing gemset /home/travis/.rvm/gemsets/default.gemsthere was an error installing gem bundler
......................
ruby-2.6.3 - #generating default wrappers..............
Error running 'run_gem_wrappers_regenerate',
please read /home/travis/.rvm/log/1560965488_ruby-2.6.3/gemset.wrappers.default.log
Using /home/travis/.rvm/gems/ruby-2.6.3
$ export BUNDLE_GEMFILE=$PWD/Gemfile
ruby.versions
$ ruby --version
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
$ rvm --version
rvm 1.29.3 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
$ bundle --version
/home/travis/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': Could not find 'bundler' (2.0.2) required by your /home/travis/build/floehopper/jamesmead.org/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.0.2`
	from /home/travis/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'
	from /home/travis/.rvm/rubies/ruby-2.6.3/bin/bundle:30:in `<main>'
$ gem --version
3.0.3
3.25s$ bundle install --jobs=3 --retry=3 --deployment
/home/travis/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': Could not find 'bundler' (2.0.2) required by your /home/travis/build/floehopper/jamesmead.org/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.0.2`
	from /home/travis/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'
	from /home/travis/.rvm/rubies/ruby-2.6.3/bin/bundle:30:in `<main>'
The command "eval bundle install --jobs=3 --retry=3 --deployment " failed. Retrying, 2 of 3.

It looks as if this might be related to this rvm issue which is fixed in this PR, which was released in rvm v1.29.4.

The build system output suggests the current rvm version is v1.29.3 which does not include this fix:

rvm version
rvm 1.29.3 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]

Could you confirm the fix with the newer RVM by adding the following?

before_install:
  - rvm get stable
1 Like

Unfortunately that doesn’t seem to work - see this build.

It looks as if the rvm get stable command is being executed after the rvm use 2.6.3 --install --binary --fuzzy command which is causing the problem.

Is there another hook like before_install which executes earlier in the build process?

Thanks for your help :slight_smile: .

It looks as if the rvm use command that I’m seeing is generated on this line.

And I can see that if I was using ruby-head as the Ruby version then that same class would generate a rvm get stable command on this line.

I’m going to try using ruby-head to see whether the problem goes away - that should give us some more clues.

Hmm. Using ruby-head did seem to “solve” the problem in that the bundle install command worked. However, I noticed the same errors were happening when importing the global gemset.

This made me think that maybe I just needed to install the relevant version of the bundler gem and indeed adding the following to my Travis config did work:

before_install:
  - gem install bundler:2.0.2

My best guess is that those errors somehow mean that no version of bundler is installed, so although I’ve got a workaround, it doesn’t seem ideal.

Getting the same error with Ruby 2.6.3 in the macOS environment:

https://travis-ci.org/scottohara/tvmanager/builds/571678878

Isn’t bundler part of Ruby now? (Since 2.6 preview 3, if I’m not mistaken).

I’m a little confused as to why we need to manually set this in .travis.yaml:

before_install:
  - gem install bundler:2.0.2

According to the docs, the minimum requirements for bundler@2.x are:

  • ruby@2.2 or higher, plus either
  • rubygems@3.x or higher (for bundler@2.0.0), or
  • rubygems@2.5.x or higher (for bundler@2.0.1)

The default ruby versions installed in the macOS xcode10.3 environment are:

Pre-installed Ruby versions
ruby-2.3.5
ruby-2.4.5

…and according to the ruby changelogs

So it would seem that the prerequisites for bundler@2.0.1 are already in place on macOS xcode10.3?

If I understand the change in https://github.com/travis-ci/travis-build/pull/1639, shouldn’t bundler 2.x be getting installed automatically?

Or is it the case that the xcode10.3 environment pre-installs bundler 1.x; so the “install bunder if not found” script doesn’t apply (because bundler is found)?

Is there a roadmap item somewhere that I can track, for when bundler 2 becomes the default installed version on macOS?

For what its worth, here’s my latest failed build log showing the issue:
https://travis-ci.org/scottohara/tvmanager/builds/572070140