# Gem::GemNotFoundException: can't find gem bundler (\>= 0.a)m Error

**URL:** <https://discuss.circleci.com/t/gem-cant-find-gem-bundler-0-a-m-error/27926>\
**Category:** Build Environment\
**Tags:** bundler, ruby, jruby, rubygems\
**Created:** [January 24, 2019, 8:30pm UTC](https://discuss.circleci.com/t/gem-cant-find-gem-bundler-0-a-m-error/27926 "2019-01-24T20:30:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![karuna24s](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/karuna24s/32/22075_2.png) [@karuna24s](https://discuss.circleci.com/u/karuna24s)\
**Post date:** [January 24, 2019, 8:30pm UTC](https://discuss.circleci.com/t/gem-cant-find-gem-bundler-0-a-m-error/27926/1 "2019-01-24T20:30:32Z")

</div>

Received the following error beginning about 11 hours ago, when I run my build this on CircleCI:

```
#!/bin/bash -eo pipefail
bundle install --jobs=4 --retry=3 --path vendor/bundle
Gem::GemNotFoundException: can't find gem bundler (>= 0.a) with executable bundle
find_spec_for_exe at /opt/jruby/lib/ruby/stdlib/rubygems.rb:289
activate_bin_path at /opt/jruby/lib/ruby/stdlib/rubygems.rb:308
         <main> at /opt/jruby/bin/bundle:23
Exited with code 1

```

The newer version of bundler is different from the gemfile.lock file. When I removed the gemfile.lock file and installed bundler, ran bundle install again: I got the following error:

```
bundle install --jobs=4 --retry=3 --path vendor/bundle
Fetching git@github.com:wcmc-its/directory-service.git
Fetching gem metadata from https://rubygems.org/.............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies.........
Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    rails (= 4.2.11) java was resolved to 4.2.11, which depends on
      bundler (&lt; 2.0, &gt;= 1.3.0) java

  Current Bundler version:
    bundler (2.0.1)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?

Could not find gem 'bundler (&lt; 2.0, &gt;= 1.3.0)', which is required by gem 'rails
(= 4.2.11)', in any of the sources.

```

Even if I install gem install bundler -v 1.17.2 (which is the version I want to use)  
The version of bundler I run in the command line returns 2.0.1

The configuration was working fine until 11 hours ago with this image  
circleci/jruby:9.2.5-browsers

The rails version I am using is 4.2.11, which seems to incompatible with bundler version 2.0.1.

Eventually, I would like to update my rails version 5, however we needs this working now. How can I use bundler version 1.17.2 instead of 2.0.1?

---

<div class="post-metadata">

**Author:** ![HarlemSquirrel](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/harlemsquirrel/32/19528_2.png) [@HarlemSquirrel](https://discuss.circleci.com/u/HarlemSquirrel)\
**Post date:** [January 25, 2019, 4:46pm UTC](https://discuss.circleci.com/t/gem-cant-find-gem-bundler-0-a-m-error/27926/2 "2019-01-25T16:46:41Z")

</div>

We were able to fix this by updating our CircleCI config to install a specific version of Bundler before running bundle install.

```
- run:
          name: install dependencies
          command: |
            gem install bundler -v 1.17.2
            bundle install --jobs=4 --retry=3 --path vendor/bundle
```

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [January 26, 2019, 11:58am UTC](https://discuss.circleci.com/t/gem-cant-find-gem-bundler-0-a-m-error/27926/3 "2019-01-26T11:58:33Z")

</div>

It is likely to result from upstream image changes outside of CircleCI’s control. If you get stuck with this sort of thing, pinning your docker image to a specific sha256 hash can be a handy short-term fix.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [April 26, 2019, 11:58am UTC](https://discuss.circleci.com/t/gem-cant-find-gem-bundler-0-a-m-error/27926/4 "2019-04-26T11:58:34Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
