Bundler versions

I haven’t used jekyll for a few months and went to use it today. Went through the install procedures to make sure it has the latest. I keep getting this message

Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.2.19). We suggest you to upgrade to the version that created the lockfile by running gem install bundler:2.2.19.

and even though I have been specific about installing version 2.2.19 , I keep getting error messages here and there. I guess the resolve is to wipe bundler 2.1.2 , or wipe everything and start again ??

Have followed the post at rubygems - Rails: How can I remove default version of bundler? - Stack Overflow , but cannot uninstall 2.1.2 as it is default, despite having re-installed version 2.2.19 and set it as default ?

The post at rubygems - Rails: How can I remove default version of bundler? - Stack Overflow , provided the answer, and I was able to uninstall bundler version 2.1.2 , and then make 2.2.19 the default

yeah same happened to me yesterday, thanks for sharing

1 Like

On macOS and Linux, you can have multiple versions of Bundler and then make sure your path is set up to use the preferred on

For example macOS has locked gems. And then if you add the path to custom Bundler at the start of PATH, then the first Bundler to be found and used will be the one you want.

You can check with

bundler --version

And see all, where the first row of results will be the one used.

which -a bundler
1 Like

Also if you have been installing in /usr/…/bin with the command quoted, you can install to a ~/.gem or ~/.local path using

gem install bundler --user-install

Then make sure the user level path is in PATH and at the start.

1 Like

Here is the output now from some of those commands @MichaelCurrin has shown:

$ echo $PATH
/home//gems/bin:/home//.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

$ which -a bundler
/home/********/gems/bin/bundler
/usr/local/bin/bundler

$ bundler --version
Bundler version 2.2.19

$ gem list bundler

*** LOCAL GEMS ***

bundler (2.2.19)

I don’t get any error messages now with Jekyll though. I remember in Python, one was able to setup a Virtual Environment that sort of ensured system wide variables and PATH’s wouldn’t override ‘local’, or more to the point, what was within the virtual environment.

I’m guessing that is what the RVM (Ruby Version Manager) is - https://rvm.io/

You to use code block otherwise your stars become markdown

e.g.

```
home/ ********/gems/bin:/home/******** /
```
home/ ********/gems/bin:/home/******** /
1 Like

This looks good to me. User Bundler preferred over system Bundler.

Remove and install Bunder.

I think update works too.

gem update bundler --user-install
1 Like

Yes when you activate a Python virtual environment it inserts values into your path. And also updates environment variables.

The Ruby environment will do the same.

So you can navigate anywhere and that path to the environment will follow you in your path.

1 Like

Yes, I did look for a ‘code’ function in the editor, but it’s not there. There is 'Pre-formatted text" though; I assume that’s it.

Okay thanks.