Skip to content

Conversation

@st0012
Copy link
Member

@st0012 st0012 commented Feb 5, 2026

Motivation

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. The chmod +t workaround from ruby/rubygems#9284 is insufficient — the pre-installed Ruby has deeper issues beyond the sticky bit.

Implementation

Remove the pre-installed Ruby 4.0 from /opt/hostedtoolcache before setup-ruby runs, forcing it to download a working build from ruby-builder.

Automated Tests

Existing CI matrix covers this — the Ruby 4.0 on ubuntu-latest job now passes.

@st0012 st0012 force-pushed the fix-ruby-4.0-ci-rubygems-update branch from 34d4dd7 to 6b2a170 Compare February 5, 2026 23:43
@st0012 st0012 changed the title Update RubyGems in CI to fix Ruby 4.0 native extension builds Fix Ruby 4.0 CI failure on ubuntu-latest Feb 6, 2026
@st0012 st0012 force-pushed the fix-ruby-4.0-ci-rubygems-update branch 2 times, most recently from 4d70bb3 to 28e0307 Compare February 6, 2026 11:03
@st0012 st0012 self-assigned this Feb 6, 2026
@st0012 st0012 added the chore Chore task label Feb 6, 2026
@st0012 st0012 force-pushed the fix-ruby-4.0-ci-rubygems-update branch 2 times, most recently from 15579ba to efc1346 Compare February 6, 2026 15:49
@st0012 st0012 marked this pull request as ready for review February 6, 2026 16:02
@st0012 st0012 requested a review from a team as a code owner February 6, 2026 16:02
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.
@st0012 st0012 force-pushed the fix-ruby-4.0-ci-rubygems-update branch from efc1346 to a2a1dbf Compare February 6, 2026 16:22
Copy link
Member

@vinistock vinistock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with the workaround for now, but can we create an issue to remove it later?

Also, let's include our current understanding. Is this a ruby/setup-ruby or a Bundler problem?

@st0012
Copy link
Member Author

st0012 commented Feb 6, 2026

It's the ubuntu-latest images's problem. It ships with Ruby 4.0.1 but that version (the version is ships, not Ruby 4.0.1) seems to have issues that prevent native gem installation.
If we use the Ruby built by setup-ruby then it'd work. But since it sees that the OS already has Ruby 4.0.1 installed, it doesn't do anything. So the workaround is to remove the cached Ruby from the image to force setup-ruby to install 4.0.1 again.

@st0012 st0012 merged commit 3ece8d5 into main Feb 6, 2026
52 of 53 checks passed
@st0012 st0012 deleted the fix-ruby-4.0-ci-rubygems-update branch February 6, 2026 17:01
peteryates added a commit to x-govuk/govuk-form-builder that referenced this pull request Feb 8, 2026
Lifted from ruby-lsp's approach here Shopify/ruby-lsp#3940
peteryates added a commit to x-govuk/govuk-form-builder that referenced this pull request Feb 8, 2026
Lifted from ruby-lsp's approach here Shopify/ruby-lsp#3940
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Chore task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants