本文介绍了全新安装 Rails 并出现 OpenSSL 错误:“已初始化常量 OpenSSL";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在尝试使用 RoR 时遇到困难.我参加了 Ruby Installfest,但遇到了我认为是 openssl.bundle 的问题.

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.

我正在使用 RVM,并且正在运行 Rails 5.0.1 和 Ruby 2.4.0

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

我尝试使用 rvm implode 完全删除/重新开始,然后按照 RailsApps Guide 但我仍然看到相同的错误.我正在运行最新版本的 macOS Sierra.

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.

这是我在 my_app 中运行 $Rake -T 时得到的输出.

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)

推荐答案

gem uninstall openssl -v 2.0.3

gem uninstall openssl -v 2.0.3

gem install openssl -v 2.0.2

gem install openssl -v 2.0.2

那应该可以解决它.

这篇关于全新安装 Rails 并出现 OpenSSL 错误:“已初始化常量 OpenSSL";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 05:49