summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/runtime.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb
index dc25b116df..1225eb9f50 100644
--- a/lib/bundler/runtime.rb
+++ b/lib/bundler/runtime.rb
@@ -62,11 +62,14 @@ module Bundler
begin
Kernel.require required_file
rescue LoadError => e
- raise if dep.autorequire || e.path != required_file
-
- if required_file.include?("-")
- required_file = required_file.tr("-", "/")
- retry
+ if dep.autorequire.nil? && e.path == required_file
+ if required_file.include?("-")
+ required_file = required_file.tr("-", "/")
+ retry
+ end
+ else
+ raise Bundler::GemRequireError.new e,
+ "There was an error while trying to load the gem '#{file}'."
end
rescue RuntimeError => e
raise Bundler::GemRequireError.new e,