Silence LoadError only if it is for rubygems itself
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.
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.
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
Affected ruby versions
No data to display