diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb index d121d82a85..cc7ec7ee71 100755 --- a/lib/rubygems/core_ext/kernel_require.rb +++ b/lib/rubygems/core_ext/kernel_require.rb @@ -38,7 +38,7 @@ module Kernel resolved_path = begin rp = nil - $LOAD_PATH[0...Gem.load_path_insert_index || -1].each do |lp| + $LOAD_PATH[0...Gem.load_path_insert_index].each do |lp| safe_lp = lp.dup.untaint next if File.symlink? safe_lp Gem.suffixes.each do |s|