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.

  1. Run gem list bundle to find out what is the current default bundler.
  2. Proceed with gem env to know about your gem environment. Look for GEM PATH to know your gem installation location, or alternatively you can use gem list -d bundler Mine is in /usr/lib/ruby/gems/x.x.x/.
  3. Go to that gem installation path and look for bundler-x.x.x.gemspec within specifications/default folder, where x.x.x is your current default bundler mentioned in step one.
  4. Remove that file.
  5. 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.