Skip to content

Commit

Permalink
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/ruby/stdlib/rubygems.rb
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
require 'thread'

module Gem
VERSION = '2.6.1'
VERSION = '2.6.2'
end

# Must be first since it unloads the prelude from 1.9.2
13 changes: 8 additions & 5 deletions lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb
Original file line number Diff line number Diff line change
@@ -121,14 +121,17 @@ def require path
rescue LoadError => load_error
RUBYGEMS_ACTIVATION_MONITOR.enter

if load_error.message.start_with?("Could not find") or
(load_error.message.end_with?(path) and Gem.try_activate(path)) then
RUBYGEMS_ACTIVATION_MONITOR.exit
return gem_original_require(path)
else
begin
if load_error.message.start_with?("Could not find") or
(load_error.message.end_with?(path) and Gem.try_activate(path)) then
require_again = true
end
ensure
RUBYGEMS_ACTIVATION_MONITOR.exit
end

return gem_original_require(path) if require_again

raise load_error
end

0 comments on commit fb71835

Please sign in to comment.