You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a reference to the first two posts of issue #67, please make sure to read them first before proceeding.
I think neither of the two gems can be considered as the real root of the problem, it's more in the combination of those both. Since devise-jwt has jwt as a dependency, consider this quote from the jwt docs:
Note: If RbNaCl is loadable, ruby-jwt will use it for HMAC-SHA256, HMAC-SHA512-256, and HMAC-SHA512. RbNaCl enforces a maximum key size of 32 bytes for these algorithms.
RbNaCl requires libsodium, it can be installed on MacOS with brew install libsodium.
Here's the error message i get, when i require devise-jwt before rbnacl/libsodium in Gemfile ( sorry for omitting it in the original post for brevity ):
/home/chris/.rvm/gems/ruby-2.5.0/gems/ffi-1.9.21/lib/ffi/library.rb:147:in `block in ffi_lib': Could not open library 'sodium': sodium: cannot open shared object file: No such file or directory.
Could not open library 'libsodium.so': libsodium.so: cannot open shared object file: No such file or directory (LoadError)
from /home/chris/.rvm/gems/ruby-2.5.0/gems/ffi-1.9.21/lib/ffi/library.rb:100:in `map'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/ffi-1.9.21/lib/ffi/library.rb:100:in `ffi_lib'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/rbnacl-5.0.0/lib/rbnacl/sodium.rb:14:in `extended'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/rbnacl-5.0.0/lib/rbnacl/sodium/version.rb:13:in `extend'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/rbnacl-5.0.0/lib/rbnacl/sodium/version.rb:13:in `<module:Version>'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/rbnacl-5.0.0/lib/rbnacl/sodium/version.rb:9:in `<module:Sodium>'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/rbnacl-5.0.0/lib/rbnacl/sodium/version.rb:7:in `<module:RbNaCl>'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/rbnacl-5.0.0/lib/rbnacl/sodium/version.rb:6:in `<top (required)>'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/rbnacl-5.0.0/lib/rbnacl.rb:6:in `<top (required)>'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/jwt-2.1.0/lib/jwt/signature.rb:11:in `<top (required)>'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/jwt-2.1.0/lib/jwt.rb:8:in `<top (required)>'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/warden-jwt_auth-0.3.5/lib/warden/jwt_auth.rb:5:in `<top (required)>'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/devise-jwt-0.5.5/lib/devise/jwt.rb:6:in `<top (required)>'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:95:in `require'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:95:in `rescue in block in require'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:72:in `block in require'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `each'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `require'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/bundler-1.16.1/lib/bundler.rb:114:in `require'
from /home/chris/Desktop/rails_projects/devise-jwt/config/application.rb:17:in `<top (required)>'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/spring-2.0.2/lib/spring/application.rb:92:in `require'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/spring-2.0.2/lib/spring/application.rb:92:in `preload'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
from /home/chris/.rvm/gems/ruby-2.5.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
from /usr/share/rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
from /usr/share/rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
from -e:1:in `<main>'
My first uneducated guess, considering this error message, would be that both gems somewhat try to access the same entity which results in an error. The words shared object file give me somewhat a hint to make me think that. But actually i can't tell for sure what's going on.
Since if you flip the order of both gems in the Gemfile, the error doesn't occur, so I think it isn't a real bug in one of the two gems since they're working fine in rails if you if you just pay attention to their order.
Didn't want to spend time to go deeper into that problem, since i found a simple solution, but could be quite interesting to know the real reason for sure.
Just thought it could be valuable to people who use devise-jwt and rbnacl-libsodium and get that same error. Took me quite some time to figure out this quite trivial solution, so others don't need to spend their valuable time on that too.. :-D
The text was updated successfully, but these errors were encountered:
devise-jwt uses ruby-jwt as a dependency, which will use RbNaCl if it is loadable, which in turns requires the external dependency libsodium. I haven't gone deep into this, but I guess that rbnacl-libsodium does some trick packaging libsodium which makes the order in the Gemfile important. If you use plain RbNaCl and install libsodium independently I guess the order would not matter.
As you say, it doesn't seem an issue here. But thank you very much for your report, this issue can act as a valuable documentation for people with the same requirements.
This is a reference to the first two posts of issue #67, please make sure to read them first before proceeding.
I think neither of the two gems can be considered as the real root of the problem, it's more in the combination of those both. Since
devise-jwt
hasjwt
as a dependency, consider this quote from thejwt
docs:Here's the error message i get, when i require
devise-jwt
beforerbnacl/libsodium
in Gemfile ( sorry for omitting it in the original post for brevity ):My first uneducated guess, considering this error message, would be that both gems somewhat try to access the same entity which results in an error. The words
shared object file
give me somewhat a hint to make me think that. But actually i can't tell for sure what's going on.Since if you flip the order of both gems in the Gemfile, the error doesn't occur, so I think it isn't a real bug in one of the two gems since they're working fine in rails if you if you just pay attention to their order.
Didn't want to spend time to go deeper into that problem, since i found a simple solution, but could be quite interesting to know the real reason for sure.
Just thought it could be valuable to people who use
devise-jwt
andrbnacl-libsodium
and get that same error. Took me quite some time to figure out this quite trivial solution, so others don't need to spend their valuable time on that too.. :-DThe text was updated successfully, but these errors were encountered: