floriandejonckheere / metal_archives

Metal Archives Web Service Ruby API wrapper
http://floriandejonckheere.github.io/metal_archives/html/
MIT License
15 stars 2 forks source link

uninitialized constant OpenSSL::Digest::OPENSSL_VERSION_NUMBER (NameError) #3

Closed Sundin closed 7 years ago

Sundin commented 7 years ago

Hi! I tried getting your API to run, but I'm getting the following error:

/usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/openssl/digest.rb:19:in `': uninitialized constant OpenSSL::Digest::OPENSSL_VERSION_NUMBER (NameError)

(oh, I also had to change all the requires in metal_archives_rb to require_relative instead... This is the first time I try out ruby though, so I don't know if this is right)

Full stack trace below:

/usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/openssl/digest.rb:19:in `': uninitialized constant OpenSSL::Digest::OPENSSL_VERSION_NUMBER (NameError) from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/openssl/digest.rb:16:in '' from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/openssl/digest.rb:15:in '<top (required)>' from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in 'require' from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in 'require' from /usr/local/lib/ruby/gems/2.4.0/gems/faraday_throttler-0.0.3/lib/faraday_throttler/key_resolver.rb:1:in '<top (required)>' from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in 'require' from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in 'require' from /usr/local/lib/ruby/gems/2.4.0/gems/faraday_throttler-0.0.3/lib/faraday_throttler/middleware.rb:4:in '<top (required)>' from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in 'require' from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in 'require' from /usr/local/lib/ruby/gems/2.4.0/gems/faraday_throttler-0.0.3/lib/faraday_throttler.rb:7:in '<top (required)>' from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:133:in 'require' from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:133:in 'rescue in require' from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:40:in 'require' from /Users/gustav/kicksort/gustav/metalarchives/metal_archives/lib/metal_archives/http_client.rb:2:in '<top (required)>' from lib/metal_archives.rb:19:in 'require_relative' from lib/metal_archives.rb:19:in '<main

floriandejonckheere commented 7 years ago

It seems there is a problem with the openssl-2.0.3 gem. Installing the previous version or using Ruby 2.4.0's bundled version (2.0.2) solves the problem:

gem install openssl -v 2.0.2

As for the require, if you use Rubygems the load path should be set correctly (it should include the gem's lib directory). I'd also recommend using something to isolate different sets of rubies and gems, such as RVM.

Sundin commented 7 years ago

Thanks!