Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using multiple Bundler versions

I've joined a project which is using bundler version 1.17.1 . Currently my system is using bundler 2.0.2 . Is there any way for me to specify a bundler version just like specifying ruby version with rbenv. Something likes:

bundler --global 1.17.1

So that, when I run the command bundler -v I will receive the result 1.71.1 rather than 2.0.2

I tried to uninstall the current bundler with gem uninstall bundler and received this message:

$ gem uninstall bundler

Select gem to uninstall:
 1. bundler-1.17.1
 2. bundler-1.17.3
 3. bundler-2.0.2
 4. All versions
> 

That makes me think there is a certain way allows me to work with multiple bundler versions. Any clues just for pointing me to where I should look up would be really appreciated.

EDIT 1

I tried bundle _1.17.1_ --version and it didn't work as I expected

$ bundler -v
Bundler version 2.0.2
$ bundle _1.17.1_ --version
Bundler version 1.17.1
$ bundler -v
Bundler version 2.0.2

expected: Bundler version 1.17.1

actual: Bundler version 2.0.2

like image 556
You Nguyen Avatar asked Jul 04 '19 03:07

You Nguyen


People also ask

What is the difference between bundle and bundler?

The executables bundle & bundler have the same functionality and therefore can be used interchangeably. You can see in the bundler/exe directory that the bundler executable just loads the bundle executable. It seems to me that the bundle command is more commonly used than the bundler command.

What is the latest version of bundler?

2.3. 4 - December 29, 2021 (394 KB) 2.3.


Video Answer


1 Answers

Try this:

1) gem install bundler -v 1.17.1

2) bundle _1.17.1_ install

like image 69
Miro Avatar answered Sep 30 '22 10:09

Miro