`gem update` fails on 4.0.9: minitest binstub not patched for RubyGems overwrite detection
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- ruby
- 领域
- build-system
调研方向
Start with libexec/package.rb, especially patch_executables, and compare its shebang matching with the minitest executable described in the issue. Review the proposed fork commit and the existing fix for issue #6 to understand the intended RubyGems marker behavior. Done means Ruby shebang variants are patched and a runtime check catches bundled gem executables RubyGems would overwrite during an offline reinstall.
由索引模型根据 Issue 内容生成。
描述
What were you trying to do when you hit this?
Updating my installed gems with gem update.
What you ran
gem update on Ruby 4.0.9 (ruby-4.0.9.macos.tar.gz), installed via mise 2026.11.14 on macOS 27.2.1 arm64.
What happened
minitest's executable "minitest" conflicts with .../installs/ruby/4.0.9/bin/minitest
Overwrite the executable? [yN]
ERROR: Error installing minitest:
"minitest" from minitest conflicts with .../installs/ruby/4.0.9/bin/minitest
minitest stays at the bundled 6.0.0. I expected it to update to 6.1.0. gem update rake on the same install works.
Version
Ruby 4.0.9, macOS arm64
Cause and fix
This is the same RubyGems overwrite detection that #6 fixed for rbs. patch_executables only matches #!/usr/bin/env ruby, but minitest 6, which is bundled from Ruby 4.0, starts its executable with #!/usr/bin/env -S ruby. Its binstub is never patched.
PRs are limited to collaborators, so the fix is on my fork: https://github.com/ArloL/ruby/commit/63e57f301fd83faba926f36d6c797b1bb3e3bba7
- Match any Ruby shebang (
^#!.*ruby.*\n) when adding the RubyGems marker. - Add a runtime check that reinstalls every bundled gem with an executable from its cached
.gem(offline). A binstub RubyGems won't overwrite now fails the build.
On the 4.0.9 macOS release tarball, the new check fails at minitest on the released binstubs and passes after the fix. With the marker stripped from all stubs (the #6 bug), it fails at bootsnap.
I hit this during a routine gem update. Claude Code helped me trace the cause and write the fix.
- 主要语言
- Ruby
- 星标
- 47
- 派生
- 9
- 平均合并
- 2 小时 41 分钟
- 30 天内合并 PR
- 6
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
相似的 Issue
-
CONTRIBUTING test list is missing diff_before_build and rules可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭good first issue help wanted
难度 1/5 1 小时以内 新手友好度 90/100
erkamyaman/rust-anything#702 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
slovensko-digital/govbox-pro#986 ·
维护者通常 1 天内回复
-
[Bug]: security/hardcoded-secret flags `${{ secrets.X }}` references in GitHub Actions workflows未关闭
难度 2/5 1-3 小时 新手友好度 77/100
scanaislop/aislop#589 ·
维护者通常 1 天内回复