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

**URL:** <https://travis-ci.community/t/error-installing-gem-gem-wrappers-rubygems-bundler-rvm-on-ruby-v2-6-3-trusty/3822>\
**Category:** Ruby\
**Created:** [June 19, 2019, 5:43pm UTC](https://travis-ci.community/t/error-installing-gem-gem-wrappers-rubygems-bundler-rvm-on-ruby-v2-6-3-trusty/3822 "2019-06-19T17:43:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![floehopper](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/floehopper/32/5906_2.png) [@floehopper](https://travis-ci.community/u/floehopper)\
**Post date:** [June 19, 2019, 5:43pm UTC](https://travis-ci.community/t/error-installing-gem-gem-wrappers-rubygems-bundler-rvm-on-ruby-v2-6-3-trusty/3822/1 "2019-06-19T17:43:17Z")

</div>

There seems to be a problem importing the global gemset on Ruby 2.6.3 on Trusty. See [this build](https://travis-ci.org/floehopper/jamesmead.org/builds/547819379) 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.
```

---

<div class="post-metadata">

**Author:** ![floehopper](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/floehopper/32/5906_2.png) [@floehopper](https://travis-ci.community/u/floehopper)\
**Post date:** [June 19, 2019, 6:06pm UTC](https://travis-ci.community/t/error-installing-gem-gem-wrappers-rubygems-bundler-rvm-on-ruby-v2-6-3-trusty/3822/2 "2019-06-19T18:06:35Z")

</div>

It looks as if this might be related to [this rvm issue](https://github.com/rvm/rvm/pull/4283) which is fixed in [this PR](https://github.com/rvm/rvm/pull/4283), which was [released in rvm v1.29.4](https://github.com/rvm/rvm/blob/master/CHANGELOG.md#1294).

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]
```

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [June 19, 2019, 6:20pm UTC](https://travis-ci.community/t/error-installing-gem-gem-wrappers-rubygems-bundler-rvm-on-ruby-v2-6-3-trusty/3822/3 "2019-06-19T18:20:37Z")

</div>

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

```auto
before_install:
  - rvm get stable

```

---

<div class="post-metadata">

**Author:** ![floehopper](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/floehopper/32/5906_2.png) [@floehopper](https://travis-ci.community/u/floehopper)\
**Post date:** [June 19, 2019, 10:22pm UTC](https://travis-ci.community/t/error-installing-gem-gem-wrappers-rubygems-bundler-rvm-on-ruby-v2-6-3-trusty/3822/4 "2019-06-19T22:22:47Z")

</div>

Unfortunately that doesn’t seem to work - see [this build](https://travis-ci.org/floehopper/jamesmead.org/builds/547941783).

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 🙂 .

---

<div class="post-metadata">

**Author:** ![floehopper](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/floehopper/32/5906_2.png) [@floehopper](https://travis-ci.community/u/floehopper)\
**Post date:** [June 19, 2019, 10:49pm UTC](https://travis-ci.community/t/error-installing-gem-gem-wrappers-rubygems-bundler-rvm-on-ruby-v2-6-3-trusty/3822/5 "2019-06-19T22:49:25Z")

</div>

It looks as if the `rvm use` command that I’m seeing is generated on [this line](https://github.com/travis-ci/travis-build/blob/960c5265c3942a9cc9276a11ad52bc2cc750021f/lib/travis/build/script/shared/rvm.rb#L124).

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](https://github.com/travis-ci/travis-build/blob/960c5265c3942a9cc9276a11ad52bc2cc750021f/lib/travis/build/script/shared/rvm.rb#L103).

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

---

<div class="post-metadata">

**Author:** ![floehopper](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/floehopper/32/5906_2.png) [@floehopper](https://travis-ci.community/u/floehopper)\
**Post date:** [June 19, 2019, 11:20pm UTC](https://travis-ci.community/t/error-installing-gem-gem-wrappers-rubygems-bundler-rvm-on-ruby-v2-6-3-trusty/3822/6 "2019-06-19T23:20:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![scottohara](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/scottohara/32/305_2.png) [@scottohara](https://travis-ci.community/u/scottohara)\
**Post date:** [August 14, 2019, 1:34pm UTC](https://travis-ci.community/t/error-installing-gem-gem-wrappers-rubygems-bundler-rvm-on-ruby-v2-6-3-trusty/3822/7 "2019-08-14T13:34:35Z")

</div>

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

[https://travis-ci.org/scottohara/tvmanager/builds/571678878](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).

---

<div class="post-metadata">

**Author:** ![scottohara](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/scottohara/32/305_2.png) [@scottohara](https://travis-ci.community/u/scottohara)\
**Post date:** [August 14, 2019, 11:59pm UTC](https://travis-ci.community/t/error-installing-gem-gem-wrappers-rubygems-bundler-rvm-on-ruby-v2-6-3-trusty/3822/8 "2019-08-14T23:59:18Z")

</div>

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

```auto
before_install:
  - gem install bundler:2.0.2

```

According to the [docs](https://docs.travis-ci.com/user/languages/ruby/#bundler-20), 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:

```auto
Pre-installed Ruby versions
ruby-2.3.5
ruby-2.4.5

```

…and according to the ruby changelogs

- [ruby 2.3](https://github.com/ruby/ruby/blob/ruby_2_3/NEWS) includes `rubygems@2.5.1`
- [ruby 2.4](https://github.com/ruby/ruby/blob/ruby_2_4/NEWS) includes `rubygems@2.6.8`

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](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](https://travis-ci.org/scottohara/tvmanager/builds/572070140)
