diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-12-06 18:03:47 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-12-06 10:10:44 +0000 |
commit | d411d8f5fe80b9c8f741ee03f91a670d5620917c (patch) | |
tree | 96d1a6fff695d359222b7ea640e3aa4cb6b069bb /lib/bundler | |
parent | e03e872eea75ee63672c755dccc340a1f6042fce (diff) | |
download | ruby-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.rb | 5 |
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) |