[rubygems/rubygems] Avoid more warnings when using RubyGems with old Bundler

We were only avoiding them when the RUBYGEMS_GEMDEPS variable is used.
Avoid the warnings in general, whenever the entrypoint to Bundler is
`require`.

8683faef36
This commit is contained in:
David Rodríguez 2025-07-10 19:46:39 +02:00 committed by Hiroshi SHIBATA
parent a93c684077
commit c3d41492e1
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2
2 changed files with 7 additions and 6 deletions

View file

@ -64,8 +64,11 @@ module Kernel
rp
end
Kernel.send(:gem, name, Gem::Requirement.default_prerelease) unless
resolved_path
next if resolved_path
Kernel.send(:gem, name, Gem::Requirement.default_prerelease)
Gem.load_bundler_extensions(Gem.loaded_specs[name].version) if name == "bundler"
next
end