From 221ba9b66c022a99227de8bf21db618666e17c42 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Sat, 17 Aug 2019 17:01:19 +0900 Subject: [PATCH] Revert "`Gem.load_path_insert_index always returns non-nil index after Ruby 1.9" This reverts commit 260ef51a73c067599826c8ab110c53994c1b6226. This broke the stable versions of Ruby like 2.4 and 2.5 --- lib/rubygems/core_ext/kernel_require.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb index b4aebf878c..5516933a5c 100755 --- a/lib/rubygems/core_ext/kernel_require.rb +++ b/lib/rubygems/core_ext/kernel_require.rb @@ -40,7 +40,7 @@ module Kernel # https://github.com/rubygems/rubygems/pull/1868 resolved_path = begin rp = nil - $LOAD_PATH[0...Gem.load_path_insert_index].each do |lp| + $LOAD_PATH[0...Gem.load_path_insert_index || -1].each do |lp| safe_lp = lp.dup.untaint next if File.symlink? safe_lp # for backword compatibility Gem.suffixes.each do |s|