Feature #18068
closedSilence LoadError only if it is for rubygems itself
Description
Background
The "Optionally load did_you_mean and RubyGems" PR (https://github.com/ruby/ruby/pull/2764) attempted to prevent raising LoadError
when requiring rubygems
because it might not be available optionally when Ruby is delivered via packaging systems and instead prints a warning message.
Context
I was working on a feature in RubyGems to better communicate to users that something went wrong when loading rubygems/defaults/operating_system
and after writing a test, I saw that any LoadError
exception raised by the rubygems will be captured and a warning will be printed instead (https://github.com/rubygems/rubygems/pull/4824). Although "Optionally load did_you_mean and RubyGems" PR intention was to prevent failure when rubygems
are not available, it's capturing every LoadError
that might happen inside the rubygems
at runtime.
Change
I have created a PR: https://github.com/ruby/ruby/pull/4719
Prevent raising the LoadError exception only if it's related directly to loading rubygems
Affected ruby versions
3.x
Updated by hsbt (Hiroshi SHIBATA) over 1 year ago
- Tracker changed from Misc to Feature
- Status changed from Open to Closed
https://github.com/ruby/ruby/pull/4719 has been merged.