-
Notifications
You must be signed in to change notification settings - Fork 236
Description
Context
Starting around Jan 28–Feb 5 2026, the ubuntu-latest runner image was updated from 20260119.4.1 to 20260126.10.1, which added Ruby 4.0.1 as a pre-installed tool in /opt/hostedtoolcache/Ruby/4.0.1/. This caused ruby/setup-ruby to skip downloading Ruby from ruby-builder and use the pre-installed version instead.
The pre-installed Ruby has broken gem directory permissions (world-writable, missing sticky bit) that cause Bundler to refuse to reinstall gems with native extensions like erb 6.0.1 (see ruby/rubygems#9284). The sticky bit is a Unix permission flag that restricts file deletion in world-writable directories to the file owner — without it, Bundler considers the directory insecure and refuses to operate.
Testing also showed issues beyond just the sticky bit — the chmod +t workaround suggested in that issue was insufficient; only a fresh ruby-builder download resolves all failures.
Workaround
In #3940, we added a CI step that removes the pre-installed Ruby 4.0 from the tool cache before setup-ruby runs:
- name: Remove pre-installed Ruby 4.0
if: matrix.os == 'ubuntu-latest' && matrix.ruby == '4.0'
run: rm -rf /opt/hostedtoolcache/Ruby/4.0*This forces setup-ruby to download a working build from ruby-builder.
When to revisit
This workaround can be removed when either of the following is true:
- The
actions/runner-imagesships a fixed pre-installed Ruby 4.0.x (with correct gem directory permissions and working native extension builds) - The upstream issue Bundler cannot reinstall [gem] because there's a previous installation of it at ... that is unsafe to remove ruby/rubygems#9284 is resolved and verified to fully fix the problem (not just the sticky bit)