alshedivat / al-folio

A beautiful, simple, clean, and responsive Jekyll theme for academics
https://alshedivat.github.io/al-folio/
MIT License
11.34k stars 11.28k forks source link

Deployment Failure Due to Nokogiri Gem Incompatibility with Ruby 3.2.2 #2682

Closed deepjyotk closed 2 months ago

deepjyotk commented 2 months ago

Have you checked that your issue isn't already filed?

Bug description

During deployment, the build process fails while attempting to install gems via Bundler. The failure occurs because the nokogiri gem (version 1.13.10-x86_64-linux) has a requirement of Ruby < 3.2.dev, >= 2.6, which is incompatible with the current Ruby version 3.2.2. As a result, the deployment is halted with an exit code 5.

How to reproduce the bug

Error messages and logs

image

`Run ruby/setup-ruby@v1 Modifying PATH Downloading Ruby Extracting Ruby Print Ruby version Installing Bundler

bundle install /opt/hostedtoolcache/Ruby/3.2.2/x64/bin/bundle config --local path /home/runner/work/deepjyotk.github.io/deepjyotk.github.io/vendor/bundle /opt/hostedtoolcache/Ruby/3.2.2/x64/bin/bundle config --local deployment true Cache key: setup-ruby-bundler-cache-v6-ubuntu-22.04-x64-ruby-3.2.2-wd-/home/runner/work/deepjyotk.github.io/deepjyotk.github.io-with--without--only--Gemfile.lock-0deeb3d141a9828c8aa70d15dddc9183df3ab5dddf9811b6a988bb4f3066ca73 /opt/hostedtoolcache/Ruby/3.2.2/x64/bin/bundle install --jobs 4 Fetching gem metadata from https://rubygems.org/....... nokogiri-1.13.10-x86_64-linux requires ruby version < 3.2.dev, >= 2.6, which is incompatible with the current version, 3.2.2 Error: The process '/opt/hostedtoolcache/Ruby/3.2.2/x64/bin/bundle' failed with exit code 5`

Gemfile currently used

`GEM remote: https://rubygems.org/ specs: activesupport (7.1.3.4) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) minitest (>= 5.1) mutex_m tzinfo (~> 2.0) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) base64 (0.2.0) bibtex-ruby (6.1.0) latex-decode (~> 0.0) racc (~> 1.7) bigdecimal (3.1.8) citeproc (1.0.10) namae (~> 1.0) citeproc-ruby (1.1.14) citeproc (~> 1.0, >= 1.0.9) csl (~> 1.6) classifier-reborn (2.3.0) fast-stemmer (~> 1.0) matrix (~> 0.4) colorator (1.1.0) concurrent-ruby (1.3.4) connection_pool (2.4.1) crass (1.0.6) csl (1.6.0) namae (~> 1.0) rexml csl-styles (1.0.1.11) csl (~> 1.0) css_parser (1.17.1) addressable cssminify2 (2.0.1) csv (3.3.0) deep_merge (1.2.2) drb (2.2.1) em-websocket (0.5.3) eventmachine (>= 0.12.9) http_parser.rb (~> 0) eventmachine (1.2.7) execjs (2.9.1) fast-stemmer (1.0.2) feedjira (3.2.1) loofah (>= 2.3.1) sax-machine (>= 1.0) ffi (1.17.0) forwardable-extended (2.6.0) gemoji (4.1.0) html-pipeline (2.14.3) activesupport (>= 2) nokogiri (>= 1.4) htmlcompressor (0.4.0) http_parser.rb (0.8.0) httparty (0.22.0) csv mini_mime (>= 1.0.0) multi_xml (>= 0.5.2) i18n (1.14.5) concurrent-ruby (~> 1.0) jekyll (4.3.3) addressable (~> 2.4) colorator (~> 1.0) em-websocket (~> 0.5) i18n (~> 1.0) jekyll-sass-converter (>= 2.0, < 4.0) jekyll-watch (~> 2.0) kramdown (~> 2.3, >= 2.3.1) kramdown-parser-gfm (~> 1.0) liquid (~> 4.0) mercenary (>= 0.3.6, < 0.5) pathutil (~> 0.9) rouge (>= 3.0, < 5.0) safe_yaml (~> 1.0) terminal-table (>= 1.8, < 4.0) webrick (~> 1.7) jekyll-archives (2.2.1) jekyll (>= 3.6, < 5.0) jekyll-email-protect (1.1.0) jekyll-feed (0.17.0) jekyll (>= 3.7, < 5.0) jekyll-get-json (1.0.0) deep_merge (~> 1.2) jekyll (>= 3.0) jekyll-imagemagick (1.4.0) jekyll (>= 3.4) jekyll-jupyter-notebook (0.0.6) jekyll jekyll-link-attributes (1.0.1) jekyll-minifier (0.1.10) cssminify2 (~> 2.0) htmlcompressor (~> 0.4) jekyll (>= 3.5) json-minify (~> 0.0.3) uglifier (~> 4.1) jekyll-paginate-v2 (3.0.0) jekyll (>= 3.0, < 5.0) jekyll-regex-replace (1.1.0) jekyll-sass-converter (2.2.0) sassc (> 2.0.1, < 3.0) jekyll-scholar (7.1.3) bibtex-ruby (~> 6.0) citeproc-ruby (~> 1.0) csl-styles (~> 1.0) jekyll (~> 4.0) jekyll-sitemap (1.4.0) jekyll (>= 3.7, < 5.0) jekyll-tabs (1.2.1) jekyll (>= 3.0, < 5.0) jekyll-toc (0.18.0) jekyll (>= 3.9) nokogiri (~> 1.12) jekyll-twitter-plugin (2.1.0) jekyll-watch (2.2.1) listen (~> 3.0) jemoji (0.13.0) gemoji (>= 3, < 5) html-pipeline (~> 2.2) jekyll (>= 3.0, < 5.0) json (2.7.2) json-minify (0.0.3) json (> 0) kramdown (2.4.0) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) latex-decode (0.4.0) libv8-node (22.5.1.0-aarch64-linux) libv8-node (22.5.1.0-arm64-darwin) libv8-node (22.5.1.0-x86_64-linux) liquid (4.0.4) listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) matrix (0.4.2) mercenary (0.4.0) mini_mime (1.1.5) mini_racer (0.13.0) libv8-node (~> 22.5.1.0) minitest (5.24.1) multi_xml (0.7.1) bigdecimal (~> 3.1) mutex_m (0.2.0) namae (1.2.0) racc (~> 1.7) nokogiri (1.13.10-aarch64-linux) racc (~> 1.4) nokogiri (1.13.10-arm64-darwin) racc (~> 1.4) nokogiri (1.13.10-x86_64-linux) racc (~> 1.4) pathutil (0.16.2) forwardable-extended (~> 2.6) public_suffix (6.0.1) racc (1.8.1) rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) rexml (3.3.6) rouge (4.3.0) safe_yaml (1.0.5) sassc (2.4.0) ffi (~> 1.9) sax-machine (1.3.2) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) tzinfo (2.0.6) concurrent-ruby (~> 1.0) uglifier (4.2.0) execjs (>= 0.3.0, < 3) unicode-display_width (2.5.0) unicode_utils (1.4.0) webrick (1.8.1)

PLATFORMS aarch64-linux arm64-darwin-23 x86_64-linux

DEPENDENCIES classifier-reborn css_parser feedjira httparty jekyll jekyll-archives jekyll-email-protect jekyll-feed jekyll-get-json jekyll-imagemagick jekyll-jupyter-notebook jekyll-link-attributes jekyll-minifier jekyll-paginate-v2 jekyll-regex-replace jekyll-scholar jekyll-sitemap jekyll-tabs jekyll-toc jekyll-twitter-plugin jemoji mini_racer unicode_utils webrick

BUNDLED WITH 2.4.22 `

What operating system are you using?

Mac

Where are you seeing the problem on?

Deployed site

More info

The application runs locally with Docker without issues, but the CI/CD pipeline fails after committing the code

jeremy-lilly commented 2 months ago

I'm running into what looks like a similar problem:

> bundle install
/opt/hostedtoolcache/Ruby/3.2.2/x64/bin/bundle config --local path /home/runner/work/jeremy-lilly.github.io/jeremy-lilly.github.io/vendor/bundle
/opt/hostedtoolcache/Ruby/3.2.2/x64/bin/bundle config --local deployment true
Cache key: setup-ruby-bundler-cache-v6-ubuntu-22.04-x64-ruby-3.2.2-wd-/home/runner/work/jeremy-lilly.github.io/jeremy-lilly.github.io-with--without--only--Gemfile.lock-c8c4a1fadd8ba5710d76a64ab6e38f9b10389ef70fa2d7fb980570793d8c5d9f
/opt/hostedtoolcache/Ruby/3.2.2/x64/bin/bundle install --jobs 4
Fetching gem metadata from https://rubygems.org/.......
Fetching rake 13.2.1
Installing rake 13.2.1
.
.
.
Fetching unicode_utils 1.4.0
Installing unicode_utils 1.4.0
Fetching addressable 2.8.6
Installing addressable 2.8.6
Downloading rexml-3.2.8 revealed dependencies not in the API or the lockfile
(strscan (>= 3.0.9)).
Running `bundle update rexml` should fix the problem.
Error: The process '/opt/hostedtoolcache/Ruby/3.2.2/x64/bin/bundle' failed with exit code 34
george-gca commented 2 months ago

Apparently @deepjyotk fixed its issue. Can you share your solution?

@jeremy-lilly I see that you pushed a very huge commit with lots of changes. It is best practice to push small commits, so it is easier to pinpoint which change introduced the error.

deepjyotk commented 2 months ago

Hey @george-gca, I've downgraded my gemfile.lock and it got fixed.

george-gca commented 2 months ago

After your site is up and running, you can upgrade your Gemfile.lock by doing a bundle update then commiting the new Gemfile.lock. Remember to test commiting ONLY this file to make sure it is the cause of some unexpected error when deploying the site.

Also note that to build the site we are currently using

https://github.com/alshedivat/al-folio/blob/b30b3f4ec0c3223366c06183b49bdb8f0a95664c/.github/workflows/deploy.yml#L73

so if you update your Gems to use a different ruby version you should also update this in all workflows.

jeremy-lilly commented 2 months ago

@george-gca, running bundle update and committing the new Gemfile.lock fixed this for me. Thanks!