Skip to content

Require http/async results in "uninitialized constant URI::WSS" in current Debian ruby (3.1.2p20) #186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
user19153 opened this issue Oct 4, 2024 · 2 comments · Fixed by #188

Comments

@user19153
Copy link

I am running the default stable version of Ruby for Debian Bookworm:

$ ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux-gnu]

When I try to require 'async/http', it reports that it doesn't know what URI:WSS is:

$ ruby -e "require 'async/http'"
/var/lib/gems/3.1.0/gems/async-http-0.80.0/lib/async/http/endpoint.rb:25:in `<class:Endpoint>': uninitialized constant URI::WSS (NameError)

				"wss" => URI::WSS,
				            ^^^^^
	from /var/lib/gems/3.1.0/gems/async-http-0.80.0/lib/async/http/endpoint.rb:20:in `<module:HTTP>'
	from /var/lib/gems/3.1.0/gems/async-http-0.80.0/lib/async/http/endpoint.rb:18:in `<module:Async>'
	from /var/lib/gems/3.1.0/gems/async-http-0.80.0/lib/async/http/endpoint.rb:17:in `<top (required)>'
	from /var/lib/gems/3.1.0/gems/async-http-0.80.0/lib/async/http/internet.rb:8:in `require_relative'
	from /var/lib/gems/3.1.0/gems/async-http-0.80.0/lib/async/http/internet.rb:8:in `<top (required)>'
	from /var/lib/gems/3.1.0/gems/async-http-0.80.0/lib/async/http.rb:11:in `require_relative'
	from /var/lib/gems/3.1.0/gems/async-http-0.80.0/lib/async/http.rb:11:in `<top (required)>'
	from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:160:in `require'
	from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:160:in `rescue in require'
	from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:149:in `require'
	from -e:1:in `<main>'
<internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- async/http (LoadError)
	from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from -e:1:in `<main>'

The error can be resolved by calling require 'uri/wss' beforehand:

$ ruby -e "require 'uri/wss'; require 'async/http'; puts 'ok'"
ok
@ioquatix
Copy link
Member

ioquatix commented Oct 4, 2024

Thanks, I can fix this.

@ioquatix
Copy link
Member

Looks like wss is missing: https://github.com/ruby/ruby/blob/v3_1_2/lib/uri.rb but was added in more recent versions of that file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants