From 9966486dce4804f28b84f3929d504143ec51808f Mon Sep 17 00:00:00 2001 From: ksss Date: Fri, 30 Jan 2026 12:08:27 +0900 Subject: [PATCH 1/2] Fix Ruby 4.0 bundle install permission error by setting BUNDLE_PATH 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 --- .github/workflows/ruby.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index ff4dab374..a7017efb9 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -65,6 +65,9 @@ jobs: if: ${{ ! contains(matrix.job, 'typecheck_test') }} run: | bundle config set without 'typecheck_test' + - name: Set bundle path to avoid permission issues + run: | + bundle config set --local path 'vendor/bundle' - name: bin/setup run: | bin/setup @@ -102,6 +105,9 @@ jobs: if: ${{ contains(matrix.ruby, 'head') }} run: | bundle config set force_ruby_platform true + - name: Set bundle path to avoid permission issues + run: | + bundle config set --local path 'vendor/bundle' - name: bin/setup run: | bin/setup From 27d05e926e16640a6899e03c12394a1395c5cce8 Mon Sep 17 00:00:00 2001 From: ksss Date: Fri, 30 Jan 2026 13:24:04 +0900 Subject: [PATCH 2/2] Use BUNDLE_PATH environment variable instead of bundle config 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 --- .github/workflows/ruby.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index a7017efb9..97af91e33 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -67,7 +67,7 @@ jobs: bundle config set without 'typecheck_test' - name: Set bundle path to avoid permission issues run: | - bundle config set --local path 'vendor/bundle' + echo "BUNDLE_PATH=vendor/bundle" >> $GITHUB_ENV - name: bin/setup run: | bin/setup @@ -107,7 +107,7 @@ jobs: bundle config set force_ruby_platform true - name: Set bundle path to avoid permission issues run: | - bundle config set --local path 'vendor/bundle' + echo "BUNDLE_PATH=vendor/bundle" >> $GITHUB_ENV - name: bin/setup run: | bin/setup