From a2a1dbf246ba51188c0de8a1a1c9ef58b7e8a706 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Thu, 5 Feb 2026 23:19:47 +0000 Subject: [PATCH] Fix Ruby 4.0 CI failure on ubuntu-latest The ubuntu-latest runner image (20260126.10+) ships a pre-installed Ruby 4.0.1 that causes native extension builds and bundler operations to fail (ruby/rubygems#9284). Remove it from the tool cache to force setup-ruby to download a working build from ruby-builder. --- .github/workflows/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f9bf5f7c..2226a4e54 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,6 +53,14 @@ jobs: with: submodules: "recursive" + # Workaround: The ubuntu-latest runner image (20260126.10+) ships a pre-installed Ruby 4.0.1 + # that causes native extension builds and bundler operations to fail. Removing it forces + # setup-ruby to download a working build from ruby-builder instead. + # See https://github.com/ruby/rubygems/issues/9284. + - name: Remove pre-installed Ruby 4.0 + if: matrix.os == 'ubuntu-latest' && matrix.ruby == '4.0' + run: rm -rf /opt/hostedtoolcache/Ruby/4.0* + - name: Set up Ruby uses: ruby/setup-ruby@90be1154f987f4dc0fe0dd0feedac9e473aa4ba8 # v1.286.0 with: