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?
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?
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
Sorry to double post! Even running the above to update bundler to the latest version didn’t seem to help. I’m still running into issues on that step. Unfortunately, this seems to mean I’m unable to update my website for the time being. Any help would be greatly appreciated!
2:53:45 AM: Executing user command: jekyll build --config _config.yml,_config_live.yml --lsi && jekyll algolia --config _config.yml,_config_live.yml
2:53:46 AM: Activating bundler (2.2.21) failed:
2:53:46 AM: Could not find 'bundler' (2.2.21) required by your /opt/build/repo/Gemfile.lock.
2:53:46 AM: To update to the latest version installed on your system, run `bundle update --bundler`.
2:53:46 AM: To install the missing version, run `gem install bundler:2.2.21`
2:53:46 AM: Checked in 'GEM_PATH=/opt/buildhome/.rvm/gems/ruby-2.6.2:/opt/buildhome/.rvm/rubies/ruby-2.6.2/lib/ruby/gems/2.6.0', execute `gem env` for more information
2:53:46 AM: To install the version of bundler this project requires, run `gem install bundler -v '2.2.21'`
It looks like this thread has been quiet for the last week. Are you still encountering this issue? If so, can you share your site name as well as any additional steps you have taken in the past week?
I am not sure we have an update past what @jen provided in April, but I am happy to do some digging for you.
I found a temporary fix, but the underlying issue still seems present. I found an older support thread that suggested using Bundler 2.0.1, and that seemed to work on my site.
However, it would be great if any version of Bundler was compatible so that I didn’t need to revert versions for the build to succeed!
Is this why my deploys are failing? i updated the bundler because i am new to all this and i couldnt get my obsidian notes to show up in jekyll feed and after that it fails to build with “materialize” cant find nokogiri in any sources. I tried updating nokogiri locally but git says there’s no difference between repo and local
I have 0 experience with bundler, github, netlify, jekyll it’s my first rodeo as they say. Can i commandline downgrade my bundler version?