aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2023-12-06 18:03:47 +0900
committergit <svn-admin@ruby-lang.org>2023-12-06 10:10:44 +0000
commitd411d8f5fe80b9c8f741ee03f91a670d5620917c (patch)
tree96d1a6fff695d359222b7ea640e3aa4cb6b069bb /lib/bundler
parente03e872eea75ee63672c755dccc340a1f6042fce (diff)
downloadruby-d411d8f5fe80b9c8f741ee03f91a670d5620917c.tar.gz
[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
Diffstat (limited to 'lib/bundler')
-rw-r--r--lib/bundler/rubygems_integration.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index b01f08ce5d..9cd4d37928 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -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)