OpenSSL无法使用gem" openssl&#34 ;: key必须是32个字节

时间:2017-01-17 17:50:05

标签: ruby-on-rails ruby openssl

也许标题不太好,但我很绝望,不知道问题出在哪里。

我需要使用gem" openssl",但是当我启动控制台时它仍会给我这个错误:

/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::VERSION
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::OPENSSL_VERSION
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::OPENSSL_LIBRARY_VERSION
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::OPENSSL_VERSION_NUMBER
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::OPENSSL_FIPS
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::Config::DEFAULT_CONFIG_FILE
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::PKCS7::Signer
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::PKCS7::TEXT
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::PKCS7::NOCERTS
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::PKCS7::NOSIGS
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::PKCS7::NOCHAIN
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::PKCS7::NOINTERN
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::PKCS7::NOVERIFY
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::PKCS7::DETACHED
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::PKCS7::BINARY
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::PKCS7::NOATTR
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::PKCS7::NOSMIMECAP
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::PKey::RSA::PKCS1_PADDING
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::PKey::RSA::SSLV23_PADDING
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::PKey::RSA::NO_PADDING
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::PKey::EC::NAMED_CURVE
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::ExtConfig::HAVE_TLSEXT_HOST_NAME
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::ExtConfig::TLS_DH_anon_WITH_AES_256_GCM_SHA384
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::SSLContext::SESSION_CACHE_OFF
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::SSLContext::SESSION_CACHE_CLIENT
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::SSLContext::SESSION_CACHE_SERVER
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::SSLContext::SESSION_CACHE_BOTH
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::SSLContext::SESSION_CACHE_NO_AUTO_CLEAR
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::SSLContext::SESSION_CACHE_NO_INTERNAL_LOOKUP
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::SSLContext::SESSION_CACHE_NO_INTERNAL_STORE
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::SSLContext::SESSION_CACHE_NO_INTERNAL
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::SSLContext::METHODS
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::ExtConfig::OPENSSL_NO_SOCK
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::VERIFY_NONE
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::VERIFY_PEER
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::VERIFY_CLIENT_ONCE
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::OP_MICROSOFT_SESS_ID_BUG
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::OP_NETSCAPE_CHALLENGE_BUG
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::OP_SSLREF2_REUSE_CERT_TYPE_BUG
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::OP_MICROSOFT_BIG_SSLV3_BUFFER
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::OP_MSIE_SSLV2_RSA_PADDING
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::OP_SSLEAY_080_CLIENT_DH_BUG
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::OP_TLS_D5_BUG
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::OP_TLS_BLOCK_PADDING_BUG
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::OP_ALL
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::OP_SINGLE_ECDH_USE
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::OP_SINGLE_DH_USE
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::OP_EPHEMERAL_RSA
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::OP_CIPHER_SERVER_PREFERENCE
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::OP_TLS_ROLLBACK_BUG
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::OP_NO_SSLv2
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::OP_NO_SSLv3
/Users/jirisverak/.rvm/gems/ruby-2.3.0@jozu/gems/openssl-2.0.2/lib/openssl.bundle: warning: already initialized constant OpenSSL::SSL::OP_NO_TLSv1
etc

和网页: enter image description here

酿造医生:您的系统已准备好酿造。 brew info openssl:

openssl: stable 1.0.2j (bottled) [keg-only]
SSL/TLS cryptography library
https://openssl.org/
/usr/local/Cellar/openssl/1.0.2j (1,695 files, 12M)
  Poured from bottle on 2017-01-17 at 10:10:07
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/openssl.rb
==> Dependencies
Build: makedepend ✘
==> Options
--universal
    Build a universal binary
--without-test
    Skip build-time tests (not recommended)
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
  /usr/local/etc/openssl/certs

and run
  /usr/local/opt/openssl/bin/c_rehash

This formula is keg-only, which means it was not symlinked into /usr/local.

Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include
    PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig

我已经从SO,互联网,空间和时间尝试了所有可能的解决方案。但错误仍然存​​在。我重新安装了10次rvm,openssl,安装了dotnet等等。

请有人能帮助我吗?否则我会破坏我的Mac并开始挖掘运河: - )

0 个答案:

没有答案