Hey hey!
When bumping ffi-compile to 1.4.1 today I notice this error:
NoMethodError: undefined method 'spec' for an instance of Gem::Specification (NoMethodError)
Taking a look, it's happening here in loader.rb:
if defined?(Gem::Specification) &&
(spec = Gem::Specification.find_active_stub_by_path(library)&.spec) &&
The object returned by Gem::Specification.find_active_stub_by_path is the actual specification itself best I can tell though I don't know if that's always true. But if I remove &.spec then the code works just fine. Won't bother with a PR since I'm not sure if removing &.spec is the right fix, or if we need to check if it's not a specification and call #spec in that case to convert it, or something else.
The library it's failing on is "libargon2_wrap.so" which gives the argon2 gem spec. Possibility that it's a bug in argon2 but figured I'd submit the issue here to see.
Cheers!
Hey hey!
When bumping ffi-compile to 1.4.1 today I notice this error:
Taking a look, it's happening here in loader.rb:
The object returned by
Gem::Specification.find_active_stub_by_pathis the actual specification itself best I can tell though I don't know if that's always true. But if I remove&.specthen the code works just fine. Won't bother with a PR since I'm not sure if removing&.specis the right fix, or if we need to check if it's not a specification and call#specin that case to convert it, or something else.The
libraryit's failing on is"libargon2_wrap.so"which gives the argon2 gem spec. Possibility that it's a bug inargon2but figured I'd submit the issue here to see.Cheers!