Actions
Bug #20644
closedRequiring URI together with the Parser gem in Ruby 3.4.0dev
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.4.0dev (2024-07-21T04:00:38Z master c544f26726) [x86_64-darwin23]
Description
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:
$ ruby -rparser -ruri -e ''
Actual (Ruby 3.4.0dev)¶
The following error occurs in the URI gem:
# 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
Actions
Like0
Like1Like0