From: "hsbt (Hiroshi SHIBATA)" Date: 2022-10-06T05:52:17+00:00 Subject: [ruby-core:110195] [Ruby master Feature#18068] Silence LoadError only if it is for rubygems itself Issue #18068 has been updated by hsbt (Hiroshi SHIBATA). Tracker changed from Misc to Feature Status changed from Open to Closed https://github.com/ruby/ruby/pull/4719 has been merged. ---------------------------------------- Feature #18068: Silence LoadError only if it is for rubygems itself https://bugs.ruby-lang.org/issues/18068#change-99473 * Author: daniel_niknam (Daniel Niknam) * Status: Closed * Priority: Normal * Assignee: hsbt (Hiroshi SHIBATA) ---------------------------------------- **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 -- https://bugs.ruby-lang.org/ Unsubscribe: