Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fresh install of Rails and getting OpenSSL errors: "already initialized constant OpenSSL"

I am stuck trying to get going with RoR. I did the Ruby Installfest, but am running into an issue with what I think is openssl.bundle.

I am using RVM, and am running Rails 5.0.1 and Ruby 2.4.0

I tried a full removal/fresh start by using rvm implode and went through and reinstalled everything following RailsApps Guide but am still seeing the identical error. I am running the latest version of macOS Sierra.

This is the output I get when running $Rake -T in my_app.

richsmith@Richs-MacBook-Pro:~/workspace/myapp$ rake -T
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle: warning: already initialized constant OpenSSL::VERSION
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle: warning: already initialized constant OpenSSL::OPENSSL_VERSION
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle: warning: already initialized constant OpenSSL::OPENSSL_LIBRARY_VERSION
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle: warning: already initialized constant OpenSSL::OPENSSL_VERSION_NUMBER
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle: warning: already initialized constant OpenSSL::OPENSSL_FIPS
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle: warning: already initialized constant OpenSSL::Config::DEFAULT_CONFIG_FILE
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle: warning: already initialized constant OpenSSL::PKCS7::Signer
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle: warning: already initialized constant OpenSSL::PKCS7::TEXT
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle: warning: already initialized constant OpenSSL::PKCS7::NOCERTS
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle: warning: already initialized constant OpenSSL::PKCS7::NOSIGS
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle: warning: already initialized constant OpenSSL::PKCS7::NOCHAIN
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle: warning: already initialized constant OpenSSL::PKCS7::NOINTERN
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle: warning: already initialized constant OpenSSL::PKCS7::NOVERIFY
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle: warning: already initialized constant OpenSSL::PKCS7::DETACHED
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle: warning: already initialized constant OpenSSL::PKCS7::BINARY
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle: warning: already initialized constant OpenSSL::PKCS7::NOATTR
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle: warning: already initialized constant OpenSSL::PKCS7::NOSMIMECAP
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle: warning: already initialized constant OpenSSL::ASN1::UNIVERSALSTRING
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle: warning: already initialized constant OpenSSL::ASN1::CHARACTER_STRING
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle: warning: already initialized constant OpenSSL::ASN1::BMPSTRING
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/pkey.rb:8: warning: already initialized constant OpenSSL::PKey::DH::DEFAULT_1024
/Users/richsmith/.rvm/gems/ruby-2.4.0@global/gems/openssl-2.0.3/lib/openssl/pkey.rb:8: warning: previous definition of DEFAULT_1024 was here
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/pkey.rb:17: warning: already initialized constant OpenSSL::PKey::DH::DEFAULT_2048
/Users/richsmith/.rvm/gems/ruby-2.4.0@global/gems/openssl-2.0.3/lib/openssl/pkey.rb:17: warning: previous definition of DEFAULT_2048 was here
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/pkey.rb:30: warning: already initialized constant OpenSSL::PKey::DEFAULT_TMP_DH_CALLBACK
/Users/richsmith/.rvm/gems/ruby-2.4.0@global/gems/openssl-2.0.3/lib/openssl/pkey.rb:30: warning: previous definition of DEFAULT_TMP_DH_CALLBACK was here
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:18: warning: constant OpenSSL::Cipher::Cipher is deprecated
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:24: warning: already initialized constant OpenSSL::Cipher::AES
/Users/richsmith/.rvm/gems/ruby-2.4.0@global/gems/openssl-2.0.3/lib/openssl/cipher.rb:24: warning: previous definition of AES was here
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:18: warning: constant OpenSSL::Cipher::Cipher is deprecated
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:24: warning: already initialized constant OpenSSL::Cipher::CAST5
/Users/richsmith/.rvm/gems/ruby-2.4.0@global/gems/openssl-2.0.3/lib/openssl/cipher.rb:24: warning: previous definition of CAST5 was here
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:18: warning: constant OpenSSL::Cipher::Cipher is deprecated
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:24: warning: already initialized constant OpenSSL::Cipher::BF
/Users/richsmith/.rvm/gems/ruby-2.4.0@global/gems/openssl-2.0.3/lib/openssl/cipher.rb:24: warning: previous definition of BF was here
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:18: warning: constant OpenSSL::Cipher::Cipher is deprecated
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:24: warning: already initialized constant OpenSSL::Cipher::DES
/Users/richsmith/.rvm/gems/ruby-2.4.0@global/gems/openssl-2.0.3/lib/openssl/cipher.rb:24: warning: previous definition of DES was here
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:18: warning: constant OpenSSL::Cipher::Cipher is deprecated
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:24: warning: already initialized constant OpenSSL::Cipher::IDEA
/Users/richsmith/.rvm/gems/ruby-2.4.0@global/gems/openssl-2.0.3/lib/openssl/cipher.rb:24: warning: previous definition of IDEA was here
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:18: warning: constant OpenSSL::Cipher::Cipher is deprecated
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:24: warning: already initialized constant OpenSSL::Cipher::RC2
/Users/richsmith/.rvm/gems/ruby-2.4.0@global/gems/openssl-2.0.3/lib/openssl/cipher.rb:24: warning: previous definition of RC2 was here
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:18: warning: constant OpenSSL::Cipher::Cipher is deprecated
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:24: warning: already initialized constant OpenSSL::Cipher::RC4
/Users/richsmith/.rvm/gems/ruby-2.4.0@global/gems/openssl-2.0.3/lib/openssl/cipher.rb:24: warning: previous definition of RC4 was here
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:18: warning: constant OpenSSL::Cipher::Cipher is deprecated
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:24: warning: already initialized constant OpenSSL::Cipher::RC5
/Users/richsmith/.rvm/gems/ruby-2.4.0@global/gems/openssl-2.0.3/lib/openssl/cipher.rb:24: warning: previous definition of RC5 was here
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:28: warning: constant OpenSSL::Cipher::Cipher is deprecated
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:33: warning: already initialized constant OpenSSL::Cipher::AES128
/Users/richsmith/.rvm/gems/ruby-2.4.0@global/gems/openssl-2.0.3/lib/openssl/cipher.rb:33: warning: previous definition of AES128 was here
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:28: warning: constant OpenSSL::Cipher::Cipher is deprecated
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:33: warning: already initialized constant OpenSSL::Cipher::AES192
/Users/richsmith/.rvm/gems/ruby-2.4.0@global/gems/openssl-2.0.3/lib/openssl/cipher.rb:33: warning: previous definition of AES192 was here
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:28: warning: constant OpenSSL::Cipher::Cipher is deprecated
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:33: warning: already initialized constant OpenSSL::Cipher::AES256
/Users/richsmith/.rvm/gems/ruby-2.4.0@global/gems/openssl-2.0.3/lib/openssl/cipher.rb:33: warning: previous definition of AES256 was here
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:64: warning: constant OpenSSL::Cipher::Cipher is deprecated
/Users/richsmith/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:64: warning: constant OpenSSL::Cipher::Cipher is deprecated
rake aborted!
TypeError: superclass mismatch for class Cipher
/Users/richsmith/.rvm/gems/ruby-2.4.0@global/gems/activesupport-5.0.1/lib/active_support/key_generator.rb:2:in `require'
/Users/richsmith/.rvm/gems/ruby-2.4.0@global/gems/activesupport-5.0.1/lib/active_support/key_generator.rb:2:in `<top (required)>'
/Users/richsmith/.rvm/gems/ruby-2.4.0@global/gems/railties-5.0.1/lib/rails/application.rb:4:in `require'
/Users/richsmith/.rvm/gems/ruby-2.4.0@global/gems/railties-5.0.1/lib/rails/application.rb:4:in `<top (required)>'
/Users/richsmith/.rvm/gems/ruby-2.4.0@global/gems/railties-5.0.1/lib/rails.rb:11:in `require'
/Users/richsmith/.rvm/gems/ruby-2.4.0@global/gems/railties-5.0.1/lib/rails.rb:11:in `<top (required)>'
/Users/richsmith/.rvm/gems/ruby-2.4.0@global/gems/railties-5.0.1/lib/rails/all.rb:1:in `require'
/Users/richsmith/.rvm/gems/ruby-2.4.0@global/gems/railties-5.0.1/lib/rails/all.rb:1:in `<top (required)>'
/Users/richsmith/workspace/myapp/config/application.rb:3:in `require'
/Users/richsmith/workspace/myapp/config/application.rb:3:in `<top (required)>'
/Users/richsmith/workspace/myapp/Rakefile:4:in `require_relative'
/Users/richsmith/workspace/myapp/Rakefile:4:in `<top (required)>'
/Users/richsmith/.rvm/gems/ruby-2.4.0@global/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
(See full trace by running task with --trace)
like image 984
Rich Avatar asked Feb 02 '17 03:02

Rich


2 Answers

gem uninstall openssl -v 2.0.3

gem install openssl -v 2.0.2

That should fix it.

like image 141
Jason Hobbs Avatar answered Oct 26 '22 15:10

Jason Hobbs


I solved this by adding the line:

gem 'openssl', '>=2.0.3'

to my gemfile. Apparently bundler is loading both the default 2.0.2 version as well as the new 2.0.3 version. The line above prevents this.

like image 28
user7528975 Avatar answered Oct 26 '22 14:10

user7528975