`bundle` is not installed for Ruby 2.3

Hi.

The travis push job fails for my github clocale repository, but only for Ruby 2.3 whereas the corresponding pr job succeeded a few minutes before for the same config

Error:

The program 'bundle' is currently not installed. To run 'bundle' please ask your administrator to install the package 'bundler'

https://travis-ci.org/avdv/clocale/jobs/474750726#L460

Update: now, the pr job also fails:

https://travis-ci.org/avdv/clocale/jobs/474773486

Update 2: after switching to xenial, the build for Ruby 2.3, 2.4 and 2.5 also fail (on Linux), but 2.6 still succeeds. What’s happening? :confused:

https://travis-ci.org/avdv/clocale/builds/474776167

Update 3: Apparently, the rvm use command already failed (without aborting the build :roll_eyes:) leading to the bundle command failure later:

ruby-2.4.4 - #importing gemset /home/travis/.rvm/gemsets/global.gems................................there was an error installing gem bundler
1 Like

The root cause is the release of bundler version 2.0, which introduces a dependency to rubygems >= 3.0. This version of gem is only available by default in Ruby 2.6. Unless your bundler version is pinned somehow the defaults will try to install 2.x, which will fail due to the presence of an older rubygem version.

This affects multiple services right now, among them Travis and Netlify. Most likely other platforms with similar build systems are affected as well.

Edit: Another way to go without bumping the Ruby version is to update rubygems itself (gem update --system), but I’m not sure if that’s possible early in the build / setup process.

2 Likes

I’m having the same issue with Ruby 2.4.2. Thanks @spiderpug for the answer!

Ah, thank you. @spiderpug

BTW, adding

before_install:
  - gem update --system
  - gem --version

to my travis config solved the issue for me.

1 Like

The before_install gem update didn’t work for me:

Updating rubygems-update
ERROR:  Error installing rubygems-update:
rubygems-update requires Ruby version >= 2.3.0.

This did the trick tho:

before_install:
    - gem install bundler -v '< 2'
2 Likes

None of the above worked for me unfortunately, but I was successful with upgrading ruby.

before_install:
- rvm install 2.6.0

I still see some non-fatal errors though:

ruby-2.6.0 - #importing gemset /home/travis/.rvm/gemsets/global.gemsthere was an error installing gem gem-wrappers
there was an error installing gem rubygems-bundler
there was an error installing gem rvm

This is now documented in https://docs.travis-ci.com/user/languages/ruby/#bundler-20.

If you continue to see problems after these remedies mentioned in the docs, do let us know.

Imprint