Project

General

Profile

Actions

Bug #19414

closed

uninitialized constant URI::WSS in 3.0.X and 3.1.X

Added by noraj (Alexandre ZANNI) almost 2 years ago. Updated over 1 year ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:112218]

Description

I have a library called ctf-party, making use of URI:WSS, and it's making my CI pipeline fails.

I'm able to reproduce it locally (bundle exec rake test), working with ruby 3.2.0 and not with 3.1.3.

The error is:

irb(main):001:0> require 'uri'
=> true
irb(main):002:0> URI::WS
=> URI::WS
irb(main):003:0> URI::WSS
(irb):3:in `<main>': uninitialized constant URI::WSS (NameError)
        from /home/noraj/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/irb-1.4.1/exe/irb:11:in `<top (required)>'
        from /home/noraj/.asdf/installs/ruby/3.1.3/bin/irb:25:in `load'
        from /home/noraj/.asdf/installs/ruby/3.1.3/bin/irb:25:in `<main>'

I don't understand why is that happening since it exists in the official documentation and the code looks ok to me on tag 3.1.3 which is strictly identical to the code on tag 3.2.0.

It works if I require the file explicitly:

irb(main):004:0> require 'uri/wss'
=> true
irb(main):005:0> URI::WSS
=> URI::WSS

The issue come from the fact that in 3.2.0 'uri/wss' is required but not in 3.1.3. In 3.0.5 it is even worse as neither ws and wss are required.

Actions

Also available in: Atom PDF

Like0
Like1Like0Like0Like0Like1Like0