How to Fix Jekyll Default Bundler Warning

I have been using Jekyll for some time now, and from time to time I encounter this warning.
Warning: the running version of Bundler (x.x.x) is older than the version that created the lockfile (y.y.y). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:y.y.y
Although it is not a big deal, it can get quite annoying.
Solution
After roaming around the internet looking for a quick fix on this matter, I found out that I need to remove bundler-x.x.x.gemspec
from ruby gems default directory, then re-install bundler with --default
flag.
Here is the rundown of what I have done.
- Run
gem list bundle
to find out what is the current default bundler. - Proceed with
gem env
to know about your gem environment. Look forGEM PATH
to know your gem installation location, or alternatively you can usegem list -d bundler
Mine is in/usr/lib/ruby/gems/x.x.x/
. - Go to that gem installation path and look for
bundler-x.x.x.gemspec
withinspecifications/default
folder, where x.x.x is your current default bundler mentioned in step one. - Remove that file.
- Install new bundler using command
gem install --default bundler
The last command will install the new bundler and mark it as the default bundler, thus removing the warning.