[rubygems/rubygems] Try to load Gem::BUNDLED_GEMS on Bundler

`bundle exec ruby foo.rb` ignore to load gem_prelude.rb. Because warnings feature
  is not working with `bundle exec ruby`.

https://github.com/rubygems/rubygems/commit/a0d4ed92a7
This commit is contained in:
Hiroshi SHIBATA 2023-12-06 18:03:47 +09:00 committed by git
parent e03e872eea
commit d411d8f5fe

View File

@ -374,6 +374,11 @@ module Bundler
specs_by_name = add_default_gems_to(specs)
reverse_rubygems_kernel_mixin
begin
# bundled_gems only provide with Ruby 3.3 or later
require "bundled_gems"
rescue LoadError
end unless defined?(::Gem::BUNDLED_GEMS)
replace_require(specs) if defined?(::Gem::BUNDLED_GEMS)
replace_gem(specs, specs_by_name)
stub_rubygems(specs)