
Issue #20644 has been updated by koic (Koichi ITO). I've confirmed that the issue is resolved with the patch. Thank you! ---------------------------------------- Bug #20644: Requiring URI together with the Parser gem in Ruby 3.4.0dev https://bugs.ruby-lang.org/issues/20644#change-109182 * Author: koic (Koichi ITO) * Status: Closed * ruby -v: ruby 3.4.0dev (2024-07-21T04:00:38Z master c544f26726) [x86_64-darwin23] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- Recently, `NameError` occurs when requiring URI together with the Parser gem in Ruby 3.4.0dev. ## Expected (Ruby 3.3.4) No errors occur in the URI gem: ```console $ ruby -rparser -ruri -e '' ``` ## Actual (Ruby 3.4.0dev) The following error occurs in the URI gem: ```console # Please run `gem i parser` if the Parser gem is not installed. $ ruby -rparser -ruri -e '' /Users/koic/.rbenv/versions/3.4-dev/lib/ruby/3.4.0+0/uri/common.rb:26:in 'Module#remove_const': constant URI::Parser not defined (NameError) remove_const(:Parser) if const_defined?(:Parser) ^^^^^^^^^^^^ from /Users/koic/.rbenv/versions/3.4-dev/lib/ruby/3.4.0+0/uri/common.rb:26:in 'URI.parser=' from /Users/koic/.rbenv/versions/3.4-dev/lib/ruby/3.4.0+0/uri/common.rb:46:in '<module:URI>' from /Users/koic/.rbenv/versions/3.4-dev/lib/ruby/3.4.0+0/uri/common.rb:15:in '<top (required)>' from /Users/koic/.rbenv/versions/3.4-dev/lib/ruby/3.4.0+0/uri.rb:94:in 'Kernel#require_relative' from /Users/koic/.rbenv/versions/3.4-dev/lib/ruby/3.4.0+0/uri.rb:94:in '<top (required)>' from <internal:/Users/koic/.rbenv/versions/3.4-dev/lib/ruby/3.4.0+0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require' from <internal:/Users/koic/.rbenv/versions/3.4-dev/lib/ruby/3.4.0+0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require' ``` Specifically, the CI for the Ruby 3.4 matrix in RuboCop fails: https://github.com/rubocop/rubocop/actions/runs/10026682635/job/27711287086 -- https://bugs.ruby-lang.org/