Using specific bundler version

bundler
ruby
rubygems

#1

Trying to install a specific version of bundler, but as you can see, the version requested to be installed is not what is being run.

rvm doesn’t exist in the path, either. How do I go about getting the correct bundler version?

The main problem is that it says bundler v 1.14.6 is installed, but I have no idea where.

#!/bin/bash -eo pipefail
sudo gem install bundler -v 1.14.6
Fetching: bundler-1.14.6.gem (100%)
Successfully installed bundler-1.14.6

#!/bin/bash -eo pipefail
which bundle
/usr/local/bin/bundle

#!/bin/bash -eo pipefail
bundle --version
Bundler version 1.15.1

#2

Which image are you using?


#3

circleci/ruby:2.3.4-node-browsers


#4

It looks like they get installed next to each other, and I don’t see a good way to specify which version to use.

circleci@4f3561dc31aa:/usr/local/lib/ruby/gems/2.3.0/gems$ ls
bundler-1.14.6  did_you_mean-1.0.0  net-telnet-0.1.1    rake-10.4.2  rubygems-update-2.6.12
bundler-1.15.1  minitest-5.8.5      power_assert-0.2.6  rdoc-4.2.1   test-unit-3.1.5

Try this instead.

echo | sudo gem uninstall bundler 
sudo gem install bundler -v 1.14.6

Then bundle --version should show the right version. The echo is necessary because gem will ask you to say “Y/n”.


#5

That worked. Thanks!


#6

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