diff --git a/lib/rubygems.rb b/lib/rubygems.rb index 3508a1f3aa..33502f6946 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -1207,7 +1207,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} ENV["BUNDLE_GEMFILE"] ||= File.expand_path(path) require 'rubygems/user_interaction' Gem::DefaultUserInteraction.use_ui(ui) do - require "bundler" + require "bundler" unless caller_locations.any? { |location| location.path.end_with?("bundler.rb") } begin @gemdeps = Bundler.setup ensure