Commit 4797365
committed
Fix kernel_require.rb packed at wrong path when rubygems-update is installed
When rubygems-update is installed (e.g. via asdf on Linux/macOS), rubygems.rb
lives in site_ruby rather than rubylibdir. Since rubygems.rb uses require_relative
to load kernel_require.rb, both files must reside in the same directory tree.
Previously kernel_require.rb was always located from rubylibdir, causing a
path mismatch at runtime: rubygems.rb in site_ruby could not find kernel_require.rb.
Fix by preferring the directory of the actually-loaded rubygems.rb from
$LOADED_FEATURES, falling back to rubylibdir for standard Ruby installations
(including RubyInstaller on Windows).1 parent ac57eed commit 4797365
2 files changed
+17
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
105 | 108 | | |
106 | 109 | | |
107 | | - | |
108 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
109 | 122 | | |
110 | 123 | | |
111 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1077 | 1077 | | |
1078 | 1078 | | |
1079 | 1079 | | |
1080 | | - | |
1081 | 1080 | | |
1082 | 1081 | | |
1083 | 1082 | | |
| |||
0 commit comments