[ruby-core:112201] [Ruby master Bug#18755] Backport rubygems/pull/5154 into Ruby 3.0