Skip to content

Commit

Permalink
[rubygems/rubygems] Try to load Gem::BUNDLED_GEMS on Bundler
Browse files Browse the repository at this point in the history
  `bundle exec ruby foo.rb` ignore to load gem_prelude.rb. Because warnings feature
  is not working with `bundle exec ruby`.

rubygems/rubygems@a0d4ed92a7
  • Loading branch information
hsbt authored and matzbot committed Dec 6, 2023
1 parent e03e872 commit d411d8f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/bundler/rubygems_integration.rb
Expand Up @@ -374,6 +374,11 @@ def replace_entrypoints(specs)
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)
Expand Down

0 comments on commit d411d8f

Please sign in to comment.