Skip to content

Commit 49c0360

Browse files
committed
Load the worktree RubyGems in the dev bundle binstub
After flattening, lib/ holds both RubyGems and Bundler, so activating the Bundler gemspec prepends the worktree lib/ over the already-booted system RubyGems. That partial overlay mixes a worktree Gem with an older system Gem::ConfigFile, which breaks native extension installs on Ruby 3.2/3.3 (undefined install_extension_in_lib) and corrupts spec names elsewhere. Route bin/bundle through switch_rubygems like bin/rspec and bin/test-unit so it re-execs onto the worktree RubyGems consistently. Point the shared gem home job at the worktree copy too, since the dev binstub can no longer load a separately installed RubyGems, and the matrix is redundant for now.
1 parent f50e07d commit 49c0360

2 files changed

Lines changed: 3 additions & 10 deletions

File tree

.github/workflows/install-rubygems.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -174,16 +174,8 @@ jobs:
174174
with:
175175
ruby-version: 3.2
176176
bundler: none
177-
- name: Save system RubyGems version to ENV
178-
run: |
179-
RGV=$(ruby -e 'puts Gem::VERSION.split(".")[0..2].join(".")')
180-
echo "RGV=v$RGV" >> $GITHUB_ENV
181-
if: matrix.rubygems == 'system'
182-
- name: Set dev RubyGems version
183-
run: |
184-
RGV=..
185-
echo "RGV=v$RGV" >> $GITHUB_ENV
186-
if: matrix.rubygems == 'dev'
177+
- name: Use the worktree RubyGems
178+
run: echo "RGV=." >> $GITHUB_ENV
187179
- name: Setup app depending on psych with initial Ruby
188180
run: mkdir foo && cd foo && ../bin/bundle init && ../bin/bundle add psych -v 5.1.2
189181
shell: bash

bin/bundle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env ruby
22
# frozen_string_literal: true
33

4+
require_relative "../spec/support/switch_rubygems"
45
require_relative "../spec/support/activate"
56

67
load File.expand_path("bundle", Spec::Path.exedir)

0 commit comments

Comments
 (0)