summaryrefslogtreecommitdiff
path: root/lib/bundler/installer/standalone.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/installer/standalone.rb')
-rw-r--r--lib/bundler/installer/standalone.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/bundler/installer/standalone.rb b/lib/bundler/installer/standalone.rb
index 11d5c490ab..2a3f5cfe35 100644
--- a/lib/bundler/installer/standalone.rb
+++ b/lib/bundler/installer/standalone.rb
@@ -55,9 +55,10 @@ module Bundler
kernel = (class << ::Kernel; self; end)
[kernel, ::Kernel].each do |k|
if k.private_method_defined?(:gem_original_require)
+ private_require = k.private_method_defined?(:require)
k.send(:remove_method, :require)
k.send(:define_method, :require, k.instance_method(:gem_original_require))
- k.send(:private, :require)
+ k.send(:private, :require) if private_require
end
end
END