Skip to content

Conversation

@deivid-rodriguez
Copy link
Contributor

What was the end-user or developer problem that led to this PR?

I run bundle console on an application and it crashed with a Bundler bug report template. However, there was not any issue in Bundler. The gem had a problem where a Ruby gem had been moved to a bundled gem and the dependency was not being declared in the gems gemspec. But that's an internal error, independent of Bundler, so it should not encourage users to report bugs to us.

What is your fix for the problem, implemented in this PR?

My fix is to change Bundler.require to not raise LoadError's but raise instead internal expected Bundler errors that are properly handled.

Make sure the following tasks are checked

It's initialized again later on.
LoadError is not a RuntimeError.
This local variable is initialized later on in this file.
At this point, `dep.autorequire` is always nil.
If a gem has an internal error, that should not make `bundle console`
print the bug report template.
@deivid-rodriguez deivid-rodriguez merged commit 55bd82a into master Jan 27, 2025
91 checks passed
@deivid-rodriguez deivid-rodriguez deleted the deivid-rodriguez/console-crash branch January 27, 2025 16:15
deivid-rodriguez added a commit that referenced this pull request Feb 17, 2025
Fix `bundle console` printing bug report template incorrectly

(cherry picked from commit 55bd82a)
Earlopain added a commit to Earlopain/rubygems that referenced this pull request Jun 30, 2025
…ng require

Followup to ruby#8436

It fixed showing the template when requiring a non-existant file but
user code can do much more than just trying to require other code.

I encountered this particular case because of load order issues, where a library wasn't able
to properly require itself when loaded before some other library.
Earlopain added a commit to Earlopain/rubygems that referenced this pull request Jun 30, 2025
…ng require

Followup to ruby#8436

It fixed showing the template when requiring a non-existant file but
user code can do much more than just trying to require other code.

I encountered this particular case because of load order issues, where a library wasn't able
to properly require itself when loaded before some other library.
Earlopain added a commit to Earlopain/rubygems that referenced this pull request Jun 30, 2025
…ng require

Followup to ruby#8436

It fixed showing the template when requiring a non-existant file but
user code can do much more than just trying to require other code.

I encountered this particular case because of load order issues, where a library wasn't able
to properly require itself when loaded before some other library.
Earlopain added a commit to Earlopain/rubygems that referenced this pull request Jun 30, 2025
…ng require

Followup to ruby#8436

It fixed showing the template when requiring a non-existant file but
user code can do much more than just trying to require other code.

I encountered this particular case because of load order issues, where a library wasn't able
to properly require itself when loaded before some other library.
deivid-rodriguez pushed a commit to Earlopain/rubygems that referenced this pull request Jul 1, 2025
…ng require

Followup to ruby#8436

It fixed showing the template when requiring a non-existant file but
user code can do much more than just trying to require other code.

I encountered this particular case because of load order issues, where a library wasn't able
to properly require itself when loaded before some other library.
matzbot pushed a commit to ruby/ruby that referenced this pull request Jul 2, 2025
… on `NameError` during require

Followup to ruby/rubygems#8436

It fixed showing the template when requiring a non-existant file but
user code can do much more than just trying to require other code.

I encountered this particular case because of load order issues, where a library wasn't able
to properly require itself when loaded before some other library.

ruby/rubygems@1c910e5afe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants