Jekyll build failure: could not find nokogiri-1.13.9 in any of the sources

Hi all, I’m a maintainer on JKAN, an open data catalog product built on Jekyll, and we’d like to point new users to Netlify as the recommended host for the next version (instead of GitHub Pages).

Unfortunately, I’m experiencing some issues deploying JKAN to Netlify.

Site details

Site name: wonderful-pie-e940bf
Git repo: GitHub - timwis-test/jkan: A lightweight, backend-free open data portal, powered by Jekyll (branch: netlify-deploy)

Error

7:26:18 AM: $ bundle exec jekyll build
7:26:19 AM: bundler: failed to load command: jekyll (/opt/build/cache/bundle/ruby/3.1.0/bin/jekyll)
7:26:19 AM: /opt/buildhome/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/bundler/definition.rb:481:in `materialize':
 Could not find nokogiri-1.13.9 in any of the sources (Bundler::GemNotFound)

Full build log

7:25:17 AM: build-image version: a2d22d22e4555d1ef0a972ed14a0a4b366ad20c4 (focal)
7:25:17 AM: build-image tag: v4.16.3
7:25:17 AM: buildbot version: 4033cea21a3d9a6b51a0c8660e8b7502a7f7abfe
7:25:17 AM: Fetching cached dependencies
7:25:17 AM: Failed to fetch cache, continuing with build
7:25:17 AM: Starting to prepare the repo for build
7:25:17 AM: No cached dependencies found. Cloning fresh repo
7:25:17 AM: git clone --filter=blob:none https://github.com/timwis-test/jkan
7:25:18 AM: Preparing Git Reference refs/heads/netlify-deploy
7:25:19 AM: Parsing package.json dependencies
7:25:20 AM: Starting build script
7:25:20 AM: Installing dependencies
7:25:20 AM: Python version set to 2.7
7:25:20 AM: v16.19.0 is already installed.
7:25:21 AM: Now using node v16.19.0 (npm v8.19.3)
7:25:21 AM: Enabling Node.js Corepack
7:25:21 AM: Started restoring cached build plugins
7:25:21 AM: Finished restoring cached build plugins
7:25:21 AM: Required ruby-3.1.2 is not installed.
7:25:21 AM: To install do: 'rvm install "ruby-3.1.2"'
7:25:21 AM: Attempting Ruby version 3.1.2, read from .ruby-version file
7:25:21 AM: Required ruby-3.1.2 is not installed - installing.
7:25:21 AM: Searching for binary rubies, this might take some time.
7:25:22 AM: Found remote file https://rubies.travis-ci.org/ubuntu/20.04/x86_64/ruby-3.1.2.tar.bz2
7:25:22 AM: Checking requirements for ubuntu.
7:25:22 AM: Requirements installation successful.
7:25:22 AM: ruby-3.1.2 - #configure
7:25:22 AM: ruby-3.1.2 - #download
7:25:23 AM: No checksum for downloaded archive, recording checksum in user configuration.
7:25:23 AM: ruby-3.1.2 - #validate archive
7:25:28 AM: ruby-3.1.2 - #extract
7:25:31 AM: ruby-3.1.2 - #validate binary
7:25:31 AM: ruby-3.1.2 - #setup
7:25:31 AM: ruby-3.1.2 - #gemset created /opt/buildhome/.rvm/gems/ruby-3.1.2@global
7:25:31 AM: ruby-3.1.2 - #importing gemset /opt/buildhome/.rvm/gemsets/global.gems........................................
7:25:32 AM: ruby-3.1.2 - #generating global wrappers........
7:25:32 AM: ruby-3.1.2 - #gemset created /opt/buildhome/.rvm/gems/ruby-3.1.2
7:25:32 AM: ruby-3.1.2 - #importing gemsetfile /opt/buildhome/.rvm/gemsets/default.gems evaluated to empty gem list
7:25:32 AM: ruby-3.1.2 - #generating default wrappers........
7:25:32 AM: Using /opt/buildhome/.rvm/gems/ruby-3.1.2
7:25:33 AM: Using Ruby version 3.1.2
7:25:33 AM: Using Bundler version 2.1.4 from Gemfile.lock
7:25:33 AM: Successfully installed bundler-2.1.4
7:25:33 AM: 1 gem installed
7:25:33 AM: Using PHP version 8.0
7:25:33 AM: Started restoring cached ruby gems
7:25:33 AM: Finished restoring cached ruby gems
7:25:33 AM: Installing gem bundle
7:25:33 AM: Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.[DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set path '/opt/build/cache/bundle'`, and stop using this flag
7:25:34 AM: [DEPRECATED] The --binstubs option will be removed in favor of `bundle binstubs`
7:25:35 AM: Fetching gem metadata from https://rubygems.org/.........
7:25:35 AM: Fetching concurrent-ruby 1.1.10
7:25:35 AM: Installing concurrent-ruby 1.1.10
7:25:35 AM: Fetching i18n 0.9.5
7:25:35 AM: Installing i18n 0.9.5
7:25:35 AM: Fetching minitest 5.16.3
7:25:35 AM: Installing minitest 5.16.3
7:25:35 AM: Fetching thread_safe 0.3.6
7:25:35 AM: Installing thread_safe 0.3.6
7:25:35 AM: Fetching tzinfo 1.2.10
7:25:35 AM: Installing tzinfo 1.2.10
7:25:35 AM: Fetching zeitwerk 2.6.6
7:25:36 AM: Installing zeitwerk 2.6.6
7:25:36 AM: Fetching activesupport 6.0.6
7:25:36 AM: Installing activesupport 6.0.6
7:25:36 AM: Fetching public_suffix 4.0.7
7:25:36 AM: Installing public_suffix 4.0.7
7:25:36 AM: Fetching addressable 2.8.1
7:25:36 AM: Installing addressable 2.8.1
7:25:36 AM: Using bundler 2.1.4
7:25:36 AM: Fetching coffee-script-source 1.11.1
7:25:36 AM: Installing coffee-script-source 1.11.1
7:25:36 AM: Fetching execjs 2.8.1
7:25:36 AM: Installing execjs 2.8.1
7:25:36 AM: Fetching coffee-script 2.4.1
7:25:36 AM: Installing coffee-script 2.4.1
7:25:36 AM: Fetching colorator 1.1.0
7:25:36 AM: Installing colorator 1.1.0
7:25:36 AM: Fetching commonmarker 0.23.6
7:25:36 AM: Installing commonmarker 0.23.6 with native extensions
7:25:43 AM: Fetching unf_ext 0.0.8.2
7:25:43 AM: Installing unf_ext 0.0.8.2 with native extensions
7:25:44 AM: Fetching unf 0.1.4
7:25:44 AM: Installing unf 0.1.4
7:25:44 AM: Fetching simpleidn 0.2.1
7:25:44 AM: Installing simpleidn 0.2.1
7:25:44 AM: Fetching dnsruby 1.61.9
7:25:44 AM: Installing dnsruby 1.61.9
7:25:44 AM: Fetching eventmachine 1.2.7
7:25:44 AM: Installing eventmachine 1.2.7 with native extensions
7:25:56 AM: Fetching http_parser.rb 0.8.0
7:25:56 AM: Installing http_parser.rb 0.8.0 with native extensions
7:25:57 AM: Fetching em-websocket 0.5.3
7:25:57 AM: Installing em-websocket 0.5.3
7:25:58 AM: Fetching ffi 1.15.5
7:25:58 AM: Installing ffi 1.15.5 with native extensions
7:26:06 AM: Fetching ethon 0.16.0
7:26:06 AM: Installing ethon 0.16.0
7:26:06 AM: Fetching faraday-net_http 3.0.1
7:26:06 AM: Installing faraday-net_http 3.0.1
7:26:06 AM: Using ruby2_keywords 0.0.5
7:26:06 AM: Fetching faraday 2.6.0
7:26:06 AM: Installing faraday 2.6.0
7:26:06 AM: Fetching forwardable-extended 2.6.0
7:26:06 AM: Installing forwardable-extended 2.6.0
7:26:06 AM: Fetching gemoji 3.0.1
7:26:06 AM: Installing gemoji 3.0.1
7:26:06 AM: Fetching sawyer 0.9.2
7:26:07 AM: Installing sawyer 0.9.2
7:26:07 AM: Fetching octokit 4.25.1
7:26:07 AM: Installing octokit 4.25.1
7:26:07 AM: Fetching typhoeus 1.4.0
7:26:07 AM: Installing typhoeus 1.4.0
7:26:07 AM: Fetching github-pages-health-check 1.17.9
7:26:07 AM: Installing github-pages-health-check 1.17.9
7:26:07 AM: Fetching rb-fsevent 0.11.2
7:26:07 AM: Installing rb-fsevent 0.11.2
7:26:07 AM: Fetching rb-inotify 0.10.1
7:26:07 AM: Installing rb-inotify 0.10.1
7:26:07 AM: Fetching sass-listen 4.0.0
7:26:07 AM: Installing sass-listen 4.0.0
7:26:07 AM: Fetching sass 3.7.4
7:26:07 AM: Installing sass 3.7.4
7:26:07 AM: Fetching jekyll-sass-converter 1.5.2
7:26:07 AM: Installing jekyll-sass-converter 1.5.2
7:26:07 AM: Fetching listen 3.7.1
7:26:07 AM: Installing listen 3.7.1
7:26:07 AM: Fetching jekyll-watch 2.2.1
7:26:07 AM: Installing jekyll-watch 2.2.1
7:26:07 AM: Fetching rexml 3.2.5
7:26:07 AM: Installing rexml 3.2.5
7:26:07 AM: Fetching kramdown 2.3.2
7:26:07 AM: Installing kramdown 2.3.2
7:26:08 AM: Fetching liquid 4.0.3
7:26:08 AM: Installing liquid 4.0.3
7:26:08 AM: Fetching mercenary 0.3.6
7:26:08 AM: Installing mercenary 0.3.6
7:26:08 AM: Fetching pathutil 0.16.2
7:26:08 AM: Installing pathutil 0.16.2
7:26:08 AM: Fetching rouge 3.26.0
7:26:08 AM: Installing rouge 3.26.0
7:26:08 AM: Fetching safe_yaml 1.0.5
7:26:08 AM: Installing safe_yaml 1.0.5
7:26:08 AM: Fetching jekyll 3.9.2
7:26:08 AM: Installing jekyll 3.9.2
7:26:08 AM: Fetching jekyll-avatar 0.7.0
7:26:08 AM: Installing jekyll-avatar 0.7.0
7:26:08 AM: Fetching jekyll-coffeescript 1.1.1
7:26:08 AM: Installing jekyll-coffeescript 1.1.1
7:26:08 AM: Fetching jekyll-commonmark 1.4.0
7:26:08 AM: Installing jekyll-commonmark 1.4.0
7:26:08 AM: Fetching jekyll-commonmark-ghpages 0.2.0
7:26:08 AM: Installing jekyll-commonmark-ghpages 0.2.0
7:26:08 AM: Fetching jekyll-default-layout 0.1.4
7:26:08 AM: Installing jekyll-default-layout 0.1.4
7:26:08 AM: Fetching jekyll-feed 0.15.1
7:26:08 AM: Installing jekyll-feed 0.15.1
7:26:08 AM: Fetching jekyll-gist 1.5.0
7:26:08 AM: Installing jekyll-gist 1.5.0
7:26:09 AM: Fetching jekyll-github-metadata 2.13.0
7:26:09 AM: Installing jekyll-github-metadata 2.13.0
7:26:09 AM: Fetching jekyll-include-cache 0.2.1
7:26:09 AM: Installing jekyll-include-cache 0.2.1
7:26:09 AM: Fetching mini_portile2 2.8.0
7:26:09 AM: Installing mini_portile2 2.8.0
7:26:09 AM: Using racc 1.6.0
7:26:09 AM: Fetching nokogiri 1.13.9 (x86_64-linux)
7:26:09 AM: Installing nokogiri 1.13.9 (x86_64-linux)
7:26:09 AM: Fetching html-pipeline 2.14.3
7:26:09 AM: Installing html-pipeline 2.14.3
7:26:09 AM: Fetching jekyll-mentions 1.6.0
7:26:09 AM: Installing jekyll-mentions 1.6.0
7:26:09 AM: Fetching jekyll-optional-front-matter 0.3.2
7:26:09 AM: Installing jekyll-optional-front-matter 0.3.2
7:26:09 AM: Fetching jekyll-paginate 1.1.0
7:26:09 AM: Installing jekyll-paginate 1.1.0
7:26:09 AM: Fetching jekyll-readme-index 0.3.0
7:26:10 AM: Installing jekyll-readme-index 0.3.0
7:26:10 AM: Fetching jekyll-redirect-from 0.16.0
7:26:10 AM: Installing jekyll-redirect-from 0.16.0
7:26:10 AM: Fetching jekyll-relative-links 0.6.1
7:26:10 AM: Installing jekyll-relative-links 0.6.1
7:26:10 AM: Fetching rubyzip 2.3.2
7:26:10 AM: Installing rubyzip 2.3.2
7:26:10 AM: Fetching jekyll-remote-theme 0.4.3
7:26:10 AM: Installing jekyll-remote-theme 0.4.3
7:26:10 AM: Fetching jekyll-seo-tag 2.8.0
7:26:10 AM: Installing jekyll-seo-tag 2.8.0
7:26:10 AM: Fetching jekyll-sitemap 1.4.0
7:26:10 AM: Installing jekyll-sitemap 1.4.0
7:26:10 AM: Fetching jekyll-swiss 1.0.0
7:26:10 AM: Installing jekyll-swiss 1.0.0
7:26:10 AM: Fetching jekyll-theme-architect 0.2.0
7:26:10 AM: Installing jekyll-theme-architect 0.2.0
7:26:10 AM: Fetching jekyll-theme-cayman 0.2.0
7:26:10 AM: Installing jekyll-theme-cayman 0.2.0
7:26:10 AM: Fetching jekyll-theme-dinky 0.2.0
7:26:10 AM: Installing jekyll-theme-dinky 0.2.0
7:26:10 AM: Fetching jekyll-theme-hacker 0.2.0
7:26:10 AM: Installing jekyll-theme-hacker 0.2.0
7:26:10 AM: Fetching jekyll-theme-leap-day 0.2.0
7:26:10 AM: Installing jekyll-theme-leap-day 0.2.0
7:26:10 AM: Fetching jekyll-theme-merlot 0.2.0
7:26:10 AM: Installing jekyll-theme-merlot 0.2.0
7:26:10 AM: Fetching jekyll-theme-midnight 0.2.0
7:26:11 AM: Installing jekyll-theme-midnight 0.2.0
7:26:11 AM: Fetching jekyll-theme-minimal 0.2.0
7:26:11 AM: Installing jekyll-theme-minimal 0.2.0
7:26:11 AM: Fetching jekyll-theme-modernist 0.2.0
7:26:11 AM: Installing jekyll-theme-modernist 0.2.0
7:26:11 AM: Fetching jekyll-theme-primer 0.6.0
7:26:11 AM: Installing jekyll-theme-primer 0.6.0
7:26:11 AM: Fetching jekyll-theme-slate 0.2.0
7:26:11 AM: Installing jekyll-theme-slate 0.2.0
7:26:11 AM: Fetching jekyll-theme-tactile 0.2.0
7:26:11 AM: Installing jekyll-theme-tactile 0.2.0
7:26:11 AM: Fetching jekyll-theme-time-machine 0.2.0
7:26:11 AM: Installing jekyll-theme-time-machine 0.2.0
7:26:11 AM: Fetching jekyll-titles-from-headings 0.5.3
7:26:11 AM: Installing jekyll-titles-from-headings 0.5.3
7:26:11 AM: Fetching jemoji 0.12.0
7:26:11 AM: Installing jemoji 0.12.0
7:26:11 AM: Fetching kramdown-parser-gfm 1.1.0
7:26:11 AM: Installing kramdown-parser-gfm 1.1.0
7:26:11 AM: Fetching minima 2.5.1
7:26:11 AM: Installing minima 2.5.1
7:26:11 AM: Fetching unicode-display_width 1.8.0
7:26:11 AM: Installing unicode-display_width 1.8.0
7:26:11 AM: Fetching terminal-table 1.8.0
7:26:11 AM: Installing terminal-table 1.8.0
7:26:12 AM: Fetching github-pages 227
7:26:12 AM: Installing github-pages 227
7:26:12 AM: Bundle complete! 2 Gemfile dependencies, 92 gems now installed.
7:26:12 AM: Bundled gems are installed into `/opt/build/cache/bundle`
7:26:12 AM: Post-install message from dnsruby:
7:26:12 AM: Installing dnsruby...
7:26:12 AM:   For issues and source code: https://github.com/alexdalitz/dnsruby
7:26:12 AM:   For general discussion (please tell us how you use dnsruby): https://groups.google.com/forum/#!forum/dnsruby
7:26:12 AM: Post-install message from sass:
7:26:12 AM: Ruby Sass has reached end-of-life and should no longer be used.
7:26:12 AM: * If you use Sass as a command-line tool, we recommend using Dart Sass, the new
7:26:12 AM:   primary implementation: https://sass-lang.com/install
7:26:12 AM: * If you use Sass as a plug-in for a Ruby web framework, we recommend using the
7:26:12 AM:   sassc gem: https://github.com/sass/sassc-ruby#readme
7:26:12 AM: * For more details, please refer to the Sass blog:
7:26:12 AM:   https://sass-lang.com/blog/posts/7828841
7:26:12 AM: Post-install message from html-pipeline:
7:26:12 AM: -------------------------------------------------
7:26:12 AM: Thank you for installing html-pipeline!
7:26:12 AM: You must bundle Filter gem dependencies.
7:26:12 AM: See html-pipeline README.md for more details.
7:26:12 AM: https://github.com/jch/html-pipeline#dependencies
7:26:12 AM: -------------------------------------------------
7:26:12 AM: Post-install message from rubyzip:
7:26:12 AM: RubyZip 3.0 is coming!
7:26:12 AM: **********************
7:26:12 AM: The public API of some Rubyzip classes has been modernized to use named
7:26:12 AM: parameters for optional arguments. Please check your usage of the
7:26:12 AM: following classes:
7:26:12 AM:   * `Zip::File`
7:26:12 AM:   * `Zip::Entry`
7:26:12 AM:   * `Zip::InputStream`
7:26:12 AM:   * `Zip::OutputStream`
7:26:12 AM: Please ensure that your Gemfiles and .gemspecs are suitably restrictive
7:26:12 AM: to avoid an unexpected breakage when 3.0 is released (e.g. ~> 2.3.0).
7:26:12 AM: See https://github.com/rubyzip/rubyzip for details. The Changelog also
7:26:12 AM: lists other enhancements and bugfixes that have been implemented since
7:26:12 AM: version 2.3.0.
7:26:12 AM: Gem bundle installed
7:26:12 AM: Started restoring cached corepack dependencies
7:26:12 AM: mv: cannot move '/opt/build/cache/.node/corepack' to '/opt/buildhome/.node/corepack': No such file or directory
7:26:12 AM: Finished restoring cached corepack dependencies
7:26:12 AM: No npm workspaces detected
7:26:12 AM: Started restoring cached node modules
7:26:12 AM: Finished restoring cached node modules
7:26:12 AM: Bypassing sha validation. Running pre & post install scripts
7:26:12 AM: Installing npm packages using npm version 8.19.3
7:26:16 AM: npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
7:26:16 AM: npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
7:26:16 AM: added 474 packages, and audited 475 packages in 4s
7:26:16 AM: 44 packages are looking for funding
7:26:16 AM:   run `npm fund` for details
7:26:16 AM: 3 high severity vulnerabilities
7:26:16 AM: To address issues that do not require attention, run:
7:26:16 AM:   npm audit fix
7:26:16 AM: Some issues need review, and may require choosing
7:26:16 AM: a different dependency.
7:26:16 AM: Run `npm audit` for details.
7:26:16 AM: npm packages installed
7:26:17 AM: Started restoring cached go cache
7:26:17 AM: Finished restoring cached go cache
7:26:17 AM: go version go1.19.4 linux/amd64
7:26:17 AM: Detected 1 framework(s)
7:26:17 AM: "jekyll" at version "unknown"
7:26:17 AM: Installing missing commands
7:26:17 AM: Verify run directory
7:26:17 AM: Section completed: initializing
7:26:18 AM: ​
7:26:18 AM:   Netlify Build                                                 
7:26:18 AM: ────────────────────────────────────────────────────────────────
7:26:18 AM: ​
7:26:18 AM: ❯ Version
7:26:18 AM:   @netlify/build 29.4.5
7:26:18 AM: ​
7:26:18 AM: ❯ Flags
7:26:18 AM:   baseRelDir: true
7:26:18 AM:   buildId: 63c4fbdc317d270008984a41
7:26:18 AM:   deployId: 63c4fbdc317d270008984a43
7:26:18 AM: ​
7:26:18 AM: ❯ Current directory
7:26:18 AM:   /opt/build/repo
7:26:18 AM: ​
7:26:18 AM: ❯ Config file
7:26:18 AM:   No config file was defined: using default values.
7:26:18 AM: ​
7:26:18 AM: ❯ Context
7:26:18 AM:   production
7:26:18 AM: ​
7:26:18 AM:   1. Build command from Netlify app                             
7:26:18 AM: ────────────────────────────────────────────────────────────────
7:26:18 AM: ​
7:26:18 AM: $ bundle exec jekyll build
7:26:19 AM: bundler: failed to load command: jekyll (/opt/build/cache/bundle/ruby/3.1.0/bin/jekyll)
7:26:19 AM: /opt/buildhome/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/bundler/definition.rb:481:in `materialize': Could not find nokogiri-1.13.9 in any of the sources (Bundler::GemNotFound)	from /opt/buildhome/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/bundler/definition.rb:190:in `specs'	from /opt/buildhome/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/bundler/definition.rb:238:in `specs_for'	from /opt/buildhome/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/bundler/runtime.rb:18:in `setup'	from /opt/buildhome/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/bundler.rb:151:in `setup'	from /opt/buildhome/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/bundler/setup.rb:20:in `block in <top (required)>'	from /opt/buildhome/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/bundler/ui/shell.rb:136:in `with_level'	from /opt/buildhome/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/bundler/ui/shell.rb:88:in `silence'	from /opt/buildhome/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/bundler/setup.rb:20:in `<top (required)>'	from /opt/buildhome/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/bundler/cli/exec.rb:56:in `require_relative'	from /opt/buildhome/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/bundler/cli/exec.rb:56:in `kernel_load'	from /opt/buildhome/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/bundler/cli/exec.rb:23:in `run'	from /opt/buildhome/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/bundler/cli.rb:484:in `exec'	from /opt/buildhome/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'	from /opt/buildhome/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'	from /opt/buildhome/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'	from /opt/buildhome/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/bundler/cli.rb:31:in `dispatch'	from /opt/buildhome/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'	from /opt/buildhome/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/bundler/cli.rb:25:in `start'	from /opt/buildhome/.rvm/rubies/ruby-3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.7/libexec/bundle:48:in `block in <top (required)>'	from /opt/buildhome/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/bundler/friendly_errors.rb:103:in `with_friendly_errors'	from /opt/buildhome/.rvm/rubies/ruby-3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.7/libexec/bundle:36:in `<top (required)>'	from /opt/build/cache/binstubs/bundle:113:in `load'	from /opt/build/cache/binstubs/bundle:113:in `<main>'​
7:26:19 AM:   "build.command" failed                                        
7:26:19 AM: ────────────────────────────────────────────────────────────────
7:26:19 AM: ​
7:26:19 AM:   Error message
7:26:19 AM:   Command failed with exit code 1: bundle exec jekyll build (https://ntl.fyi/exit-code-1)
7:26:19 AM: ​
7:26:19 AM:   Error location
7:26:19 AM:   In Build command from Netlify app:
7:26:19 AM:   bundle exec jekyll build
7:26:19 AM: ​
7:26:19 AM:   Resolved config
7:26:19 AM:   build:
7:26:19 AM:     command: bundle exec jekyll build
7:26:19 AM:     commandOrigin: ui
7:26:19 AM:     publish: /opt/build/repo/_site
7:26:19 AM:     publishOrigin: ui
7:26:19 AM: Caching artifacts
7:26:19 AM: Started saving ruby gems
7:26:19 AM: Finished saving ruby gems
7:26:20 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
7:26:19 AM: Started saving node modules
7:26:19 AM: Finished saving node modules
7:26:19 AM: Started saving build plugins
7:26:19 AM: Finished saving build plugins
7:26:19 AM: Started saving pip cache
7:26:19 AM: Finished saving pip cache
7:26:19 AM: Started saving emacs cask dependencies
7:26:19 AM: Finished saving emacs cask dependencies
7:26:19 AM: Started saving maven dependencies
7:26:19 AM: Finished saving maven dependencies
7:26:19 AM: Started saving boot dependencies
7:26:19 AM: Finished saving boot dependencies
7:26:19 AM: Started saving rust rustup cache
7:26:19 AM: Finished saving rust rustup cache
7:26:19 AM: Started saving go dependencies
7:26:19 AM: Finished saving go dependencies
7:26:20 AM: Cached Ruby version 3.1.2
7:26:20 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
7:26:20 AM: Failing build: Failed to build site
7:26:20 AM: Finished processing build request in 1m3.10604647s

And my Gemfile, for reference:

source "https://rubygems.org"

gem "github-pages", group: :jekyll_plugins
gem "jekyll", "~> 3.9"

Troubleshooting steps

  • I’ve tried with and without a netlify.toml file
  • I’ve tried using the build command jekyll build and bundle exec jekyll build
  • I’ve tried adding a .ruby-version file, switching it from 2.7 to 3.1.2
  • I’ve verified that the bundler version in Gemfile.lock matches the bundler version in the Netlify build log
  • I’ve verified the Netlify build log shows Nokogiri 1.13.9 as being installed
  • I’ve searched to the end of the internet and back

Thanks in advance for any help you can provide.

Hey @timwis ! Thanks for all the context you provided on this, that helps.

I’m wondering if you can check to see if the module exists? Here is a guide you can follow to echo the specific module:

gem list -i "^nokogiri-1.13.9$"

Once you give that a try, can you share the output?

Thanks @amelia, but I must have been dreaming about this problem last night, because I woke up with an inkling of what might be going on: I’m using an M1 MacBook, and I was wondering whether my Gemfile.lock might be pinning a version that’s exclusive to that chip’s architecture.

I did some digging and came across rubygems/rubygems#4269, and it looked like I was on to something!

My Gemfile.lock had this in it:

PLATFORMS
  ruby
  x64-mingw32

I ran this command locally:

$ bundle lock --add-platform x86_64-linux

And it produced this diff:

      racc (~> 1.4)
    nokogiri (1.13.9-x64-mingw32)
      racc (~> 1.4)
+   nokogiri (1.13.9-x86_64-linux)
+     racc (~> 1.4)
    octokit (4.25.1)
      faraday (>= 1, < 3)
      sawyer (~> 0.9)
@@ -261,6 +263,7 @@ GEM
PLATFORMS
  ruby
  x64-mingw32
+ x86_64-linux

DEPENDENCIES
  github-pages

I pushed that up to my git repo, and Netlify deployed it just fine.

I’m not sure why Netlify wasn’t able to deploy it with just the ruby platform (in that GitHub thread, it looked like the ruby platform was sufficient for it to work on Heroku), but that’s a bit over my head. I also don’t know what x64-mingw32 is or how that got there (I’d have expected darwin or arm or something). But hopefully this helps if someone has this issue in the future!

Hi @timwis :wave:t6:

Thanks for coming back and sharing this with the community.