ruby / uri

URI is a module providing classes to handle Uniform Resource Identifiers
https://ruby.github.io/uri/
Other
85 stars 46 forks source link

constant URI::HOST not defined (NameError) #134

Closed MarioRuiz closed 1 week ago

MarioRuiz commented 1 week ago

URI v 1.0.1 When already defined the constant HOST getting the error constant URI::HOST not defined (NameError)

To reproduce this issue:

HOST = "http://www.ruby-lang.org/ja/"
require "uri"
uri = URI.parse(HOST)
puts uri.host

output:

/gems/3.2.0/gems/uri-1.0.1/lib/uri/common.rb:42:in `remove_const': constant URI::HOST not defined (NameError)

      remove_const(sym) if const_defined?(sym)