aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/core_ext/kernel_require.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/core_ext/kernel_require.rb')
-rwxr-xr-xlib/rubygems/core_ext/kernel_require.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb
index 6c00f3fd9b..99093a1338 100755
--- a/lib/rubygems/core_ext/kernel_require.rb
+++ b/lib/rubygems/core_ext/kernel_require.rb
@@ -121,14 +121,17 @@ module Kernel
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