# \`bundle\` is not installed for Ruby 2.3

**URL:** <https://travis-ci.community/t/bundle-is-not-installed-for-ruby-2-3/1641>\
**Category:** Ruby\
**Created:** [January 3, 2019, 9:47am UTC](https://travis-ci.community/t/bundle-is-not-installed-for-ruby-2-3/1641 "2019-01-03T09:47:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![avdv](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/avdv/32/3214_2.png) [@avdv](https://travis-ci.community/u/avdv)\
**Post date:** [January 3, 2019, 9:47am UTC](https://travis-ci.community/t/bundle-is-not-installed-for-ruby-2-3/1641/1 "2019-01-03T09:47:58Z")

</div>

Hi.

The travis [push job](https://travis-ci.org/avdv/clocale/builds/474750725) fails for my github clocale repository, but only for Ruby 2.3 whereas the corresponding [pr job](https://travis-ci.org/avdv/clocale/builds/474695869) succeeded a few minutes before for the same [config](https://travis-ci.org/avdv/clocale/jobs/474750726/config)

Error:

```auto
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](https://travis-ci.org/avdv/clocale/jobs/474750726#L460)

**Update** : now, the pr job also fails:

[https://travis-ci.org/avdv/clocale/jobs/474773486](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? 😕

[https://travis-ci.org/avdv/clocale/builds/474776167](https://travis-ci.org/avdv/clocale/builds/474776167)

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

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

```

---

<div class="post-metadata">

**Author:** ![spiderpug](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@spiderpug](https://travis-ci.community/u/spiderpug)\
**Post date:** [January 3, 2019, 10:08am UTC](https://travis-ci.community/t/bundle-is-not-installed-for-ruby-2-3/1641/2 "2019-01-03T10:08:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![iris](https://avatars.discourse-cdn.com/v4/letter/i/a5b964/32.png) [@iris](https://travis-ci.community/u/iris)\
**Post date:** [January 3, 2019, 10:10am UTC](https://travis-ci.community/t/bundle-is-not-installed-for-ruby-2-3/1641/3 "2019-01-03T10:10:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![avdv](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/avdv/32/3214_2.png) [@avdv](https://travis-ci.community/u/avdv)\
**Post date:** [January 3, 2019, 10:10am UTC](https://travis-ci.community/t/bundle-is-not-installed-for-ruby-2-3/1641/4 "2019-01-03T10:10:44Z")

</div>

Ah, thank you. @spiderpug

---

<div class="post-metadata">

**Author:** ![avdv](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/avdv/32/3214_2.png) [@avdv](https://travis-ci.community/u/avdv)\
**Post date:** [January 3, 2019, 10:18am UTC](https://travis-ci.community/t/bundle-is-not-installed-for-ruby-2-3/1641/5 "2019-01-03T10:18:35Z")

</div>

BTW, adding

```auto
before_install:
  - gem update --system
  - gem --version

```

to my travis config solved the issue for me.

---

<div class="post-metadata">

**Author:** ![lbjay](https://avatars.discourse-cdn.com/v4/letter/l/ecae2f/32.png) [@lbjay](https://travis-ci.community/u/lbjay)\
**Post date:** [January 3, 2019, 4:15pm UTC](https://travis-ci.community/t/bundle-is-not-installed-for-ruby-2-3/1641/6 "2019-01-03T16:15:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![billatgg](https://avatars.discourse-cdn.com/v4/letter/b/e47774/32.png) [@billatgg](https://travis-ci.community/u/billatgg)\
**Post date:** [January 3, 2019, 11:30pm UTC](https://travis-ci.community/t/bundle-is-not-installed-for-ruby-2-3/1641/7 "2019-01-03T23:30:24Z")

</div>

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

---

<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:** [January 15, 2019, 2:47pm UTC](https://travis-ci.community/t/bundle-is-not-installed-for-ruby-2-3/1641/8 "2019-01-15T14:47:55Z")

</div>

This is now documented in [https://docs.travis-ci.com/user/languages/ruby/#bundler-20](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.
