aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems.rb')
-rw-r--r--lib/rubygems.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index 7af0694402..dd01fa3838 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -577,6 +577,10 @@ module Gem
# gem's paths are inserted before site lib directory by default.
def self.load_path_insert_index
+ $LOAD_PATH.each_with_index do |path, i|
+ return i if path.instance_variable_defined?(:@gem_prelude_index)
+ end
+
index = $LOAD_PATH.index RbConfig::CONFIG['sitelibdir']
index