Bundler version mismatch + nokgiri dependency issue failing Jekyll builds

The basics

  • Netlify site: xenodochial-feynman-1c9012
  • Failing build log link: Netlify App

Hi all, I think Netlify’s build process may not be respecting my bundler version and that’s resulting in it identifying a package (nokogiri) as missing that seems to be present.

Pieces of the puzzle:

  • My Gemfile lists 2.1.4 as the version it’s bundled with.
  • Netlify’s build indicates it is using 2.1.4: Using bundler version 2.1.4 from Gemfile.lock (line 24); Successfully installed bundler-2.1.4 (line 25); Using bundler 2.1.4 (line 48)
  • Netlify’s build indicates it is installing nokogiri 1.11.3: Fetching nokogiri 1.11.3 (x86_64-linux) (line 149); Installing nokogiri 1.11.3 (x86_64-linux) (line 150)

The Problem

However, during the Jekyll build command (jekyll build --future true, line 304) , I see:

/opt/buildhome/.rvm/gems/ruby-2.6.2/gems/bundler-2.2.15/lib/bundler/spec_set.rb:89:in block in materialize': Could not find nokogiri-1.11.3 in any of the sources (Bundler::GemNotFound)

This seems to indicate that Netlify’s build is using bundler 2.2.15 rather than 2.1.4 as I would expect, and as its own build seems to expect.

Questions / Asks

  • What is the best way to resolve this error? Do I absolutely have to update my bundler version?
  • In general, do I need to have my site built with a specific version of bundler in order to stay in sync with Netlify requirements? If so, is that listed somewhere, or is there a place I could submit a pull request in order to surface this as a warning?

Thanks in advance for your insight!

I was able to resolve the issue by updating my local bundler to the latest (v2.2.16 at the time of this post):

  • gem install bundler
  • bundle update --bundler

But I’d love to know if there was a way to do it without requiring me to make a change to my dependencies in this way. Is there a reason for the mismatch when a specific version is specified?

1 Like

Hey @SeanKilleen,
I checked our build-image repo to see if I could find the answer to your question… and I found a PR you opened last year! So I’m guessing you know enough to look around that repo as well and that I won’t be telling you anything you don’t already know. It seems like we fixed the issue you’re running into, so perhaps there has been a regression: Use installed bundler version from Gemfile.lock by Benaiah · Pull Request #350 · netlify/build-image · GitHub I’ll link to this thread there and see if we can get some :eyes: