`gem update` fails on 4.0.9: minitest binstub not patched for RubyGems overwrite detection
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- ruby
- Área
- build-system
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Ruby
- Estrellas
- 47
- Forks
- 9
- Merge medio
- 2 h 41 min
- PR fusionados (30 d)
- 6
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Issues similares
-
CONTRIBUTING test list is missing diff_before_build and rulesPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertogood first issue help wanted
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
erkamyaman/rust-anything#702 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
slovensko-digital/govbox-pro#986 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: security/hardcoded-secret flags `${{ secrets.X }}` references in GitHub Actions workflowsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
scanaislop/aislop#589 ·
Los mantenedores suelen responder en 1 día