[rubygems/rubygems] Fix gem update --system crash while regenerating binstubs
Since a few commits ago, we no longer call Gem::Specification.reset
after each invocation of Gem::Installer#install. This means we don't
call it when the default Bundler is installed during gem update --system. This causes no issues until the end of the upgrade process
when:
The previous default Bundler spec is removed from disk.
All specification stubs are turned into real specifications by loading
them from disk. But the one for Bundler no longer exists so
materializes to nil and regenerating binstubs crashes like this:
[rubygems/rubygems] Fix
gem update --system
crash while regenerating binstubsSince a few commits ago, we no longer call
Gem::Specification.reset
after each invocation of
Gem::Installer#install
. This means we don'tcall it when the default Bundler is installed during
gem update --system
. This causes no issues until the end of the upgrade processwhen:
The previous default Bundler spec is removed from disk.
All specification stubs are turned into real specifications by loading
them from disk. But the one for Bundler no longer exists so
materializes to
nil
and regenerating binstubs crashes like this:We fix it by more carefully managing the removal of the previous default
Bundler gem.
https://github.com/rubygems/rubygems/commit/9989f6d5af