Skip to content
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

HTTP2::Client.new throws ArgumentError (wrong number of arguments (given 1, expected 0)) on Ruby 3.0 #158

Closed
rgaufman opened this issue Dec 28, 2020 · 3 comments

Comments

@rgaufman
Copy link

I'm getting this:

irb(main):001:0> require 'http/2'
=> true
irb(main):002:0> conn = HTTP2::Client.new
Traceback (most recent call last):
        9: from /opt/homebrew/opt/ruby/bin/irb:23:in `<main>'
        8: from /opt/homebrew/opt/ruby/bin/irb:23:in `load'
        7: from /opt/homebrew/Cellar/ruby/3.0.0_1/lib/ruby/gems/3.0.0/gems/irb-1.3.0/exe/irb:11:in `<top (required)>'
        6: from (irb):2:in `<main>'
        5: from (irb):2:in `new'
        4: from /opt/homebrew/lib/ruby/gems/3.0.0/gems/http-2-0.10.2/lib/http/2/client.rb:28:in `initialize'
        3: from /opt/homebrew/lib/ruby/gems/3.0.0/gems/http-2-0.10.2/lib/http/2/connection.rb:79:in `initialize'
        2: from /opt/homebrew/lib/ruby/gems/3.0.0/gems/http-2-0.10.2/lib/http/2/connection.rb:79:in `new'
        1: from /opt/homebrew/lib/ruby/gems/3.0.0/gems/http-2-0.10.2/lib/http/2/compressor.rb:333:in `initialize'
ArgumentError (wrong number of arguments (given 1, expected 0))

This is my environment

Romans-MacBook-Pro-2.local ➜  bin  ruby --version
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [arm64-darwin20]
Romans-MacBook-Pro-2.local ➜  bin  gem --version net-http2
3.2.3
Romans-MacBook-Pro-2.local ➜  bin  uname -a
Darwin Romans-MacBook-Pro-2.local 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec  2 20:40:21 PST 2020; root:xnu-7195.60.75~1/RELEASE_ARM64_T8101 arm64

Any ideas?

@piotaixr
Copy link

It seems related to the way Ruby 3 handles named parameters. The issue seems fixed on master with #156

@alextwoods
Copy link
Contributor

@igrigorik - any idea when this fix will get released as a new gem version? The AWS SDK for Ruby currently breaks with the latest gem version of http-2 on Ruby 3.0, but I've confirmed all our tests pass when using the latest from master.

@igrigorik
Copy link
Owner

New release is live, this should be resolved. Please reopen if you run into any other issues!

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

No branches or pull requests

4 participants