Skip to content

Conversation

@ksss
Copy link
Collaborator

@ksss ksss commented Jan 30, 2026

Problem

Ruby 4.0.1 CI jobs fail with permission error when trying to reinstall erb:

Bundler cannot reinstall erb-6.0.1 because there's a previous installation of it
at /opt/hostedtoolcache/Ruby/4.0.1/x64/lib/ruby/gems/4.0.0/gems/erb-6.0.1 that
is unsafe to remove.

Failed run: https://github.com/ruby/rbs/actions/runs/21500893368/job/61946774227

Solution

Set BUNDLE_PATH to vendor/bundle to avoid the problematic system gem directory.

This is a temporary workaround. Similar issue occurred with Ruby 3.2 and was resolved upstream:

ksss and others added 2 commits January 30, 2026 12:08
Ruby 4.0.1 CI jobs are failing with this error:
```
Bundler cannot reinstall erb-6.0.1 because there's a previous installation of it
at /opt/hostedtoolcache/Ruby/4.0.1/x64/lib/ruby/gems/4.0.0/gems/erb-6.0.1 that
is unsafe to remove.
The parent of /opt/hostedtoolcache/Ruby/4.0.1/x64/lib/ruby/gems/4.0.0/gems/erb-6.0.1 is
world-writable and does not have the sticky bit set, making it insecure to
remove due to potential vulnerabilities.
```

This is caused by GitHub Actions runner image having improper permissions
for Ruby 4.0.1's gem directory. This is similar to the issue that was
fixed for Ruby 3.2 in 2024:
- ruby/setup-ruby#624
- actions/runner-images#10215

Workaround: Set bundle path to vendor/bundle to avoid using the
problematic system gem directory. This is a temporary fix until the
upstream issue is resolved.

Co-Authored-By: Claude <noreply@anthropic.com>
Using 'bundle config set --local path' caused issues with multiple
Gemfile setups (root Gemfile and steep/Gemfile). The environment
variable approach is cleaner and doesn't persist configuration to
.bundle/config.

Co-Authored-By: Claude <noreply@anthropic.com>
@ksss ksss closed this Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant