summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Rodríguez <[email protected]>2025-01-24 17:46:47 +0100
committerHiroshi SHIBATA <[email protected]>2025-01-28 15:31:57 +0900
commit9b2ebfc7294a61eec32962be0547dec8321b8330 (patch)
tree951d8d2dc137df0506a57297f9d000c6705d17a4 /lib
parent83b4de8520e6ef10dfb0207c923f8ad343282d6d (diff)
[rubygems/rubygems] Fix bug report template incorrectly showing up
If a gem has an internal error, that should not make `bundle console` print the bug report template. https://github.com/rubygems/rubygems/commit/7432a9a084
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,