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

need to require 'forwardable' to use Forwardable #316

Closed
mikegee opened this issue May 23, 2019 · 4 comments · Fixed by #317
Closed

need to require 'forwardable' to use Forwardable #316

mikegee opened this issue May 23, 2019 · 4 comments · Fixed by #317
Assignees
Labels

Comments

@mikegee
Copy link

mikegee commented May 23, 2019

I get an error from JWT 2.2.0 on Ruby 2.3 and 2.5.

JWT::JWK::RSA extends Forwardable, but there is no require 'forwardable' in the gem. I worked around this in my script by explicitly requiring forwardable.

This fails:

% docker run --rm -it ruby:2.3 ruby -e 'class MyClass; extend Forwardable; end'
-e:1:in `<class:MyClass>': uninitialized constant MyClass::Forwardable (NameError)
	from -e:1:in `<main>'

This doesn't fail:

% docker run --rm -it ruby:2.3 ruby -e 'require "forwardable"; class MyClass; extend Forwardable; end'
@excpt excpt self-assigned this May 23, 2019
@excpt excpt added review required and removed bug labels May 23, 2019
@excpt
Copy link
Member

excpt commented May 23, 2019

Which version of openssl is installed in you environment?

Please try to update it to version ~> 2.1.

@mikegee
Copy link
Author

mikegee commented May 23, 2019

Looks like the official Ruby 2.3 docker image comes with OpenSSL 1.1.1:

% docker run --rm -it ruby:2.3 ruby -ropenssl -e'puts OpenSSL::VERSION'
1.1.1

I'm not interested in updating a system library, nor do I understand how it is related, since require 'forwardable' resolves the problem.

@btyy77c
Copy link

btyy77c commented May 23, 2019

I've had the same problem: https://github.com/railscltgroup/firebase_auth/blob/master/lib/firebase_ruby_auth.rb
JWT 2.2.0 and Ruby 2.6.2

I have a similar file in a personal Rails app. I don't get any errors in my Rails app. However, when I'm just working on this gem, the require 'jwt' command errors out. require 'forwardable' seems to fix the error.

@excpt
Copy link
Member

excpt commented May 24, 2019

@mikegee @btyy77c

Version 2.2.1 just released. This should fix he missing dependency issue for you.

Thanks for the detailed reporting!

bdewater pushed a commit to bdewater/ruby-jwt that referenced this issue Nov 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants