diff options
-rw-r--r-- | lib/bundler/rubygems_integration.rb | 2 | ||||
-rw-r--r-- | spec/runtime/setup_spec.rb | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index 88fcd4d9e0..18da5915a5 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "rubygems" + module Bundler class RubygemsIntegration if defined?(Gem::Ext::Builder::CHDIR_MONITOR) diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb index befc5f9d09..39240b7404 100644 --- a/spec/runtime/setup_spec.rb +++ b/spec/runtime/setup_spec.rb @@ -1344,5 +1344,11 @@ end expect(last_command.stdboth).not_to include "FAIL" expect(err).to include "private method `require'" end + + it "takes care of requiring rubygems" do + sys_exec("#{Gem.ruby} -I#{lib_dir} -e \"puts require('bundler/setup')\"", "RUBYOPT" => "--disable=gems") + + expect(last_command.stdboth).to eq("true") + end end end |