我正在尝试安装一个新的 gem (gem install lunchy
),但由于 ssl 证书出现以下错误:
错误:加载命令:安装(LoadError)
dlopen(/usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin12.3.0/openssl.bundle,9):找不到符号:_SSLv2_client_method
引用自:/usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin12.3.0/openssl.bundle
预计在:/usr/local/opt/openssl/lib/libssl.1.0.0.dylib
在/usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin12.3.0/openssl.bundle -/usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin12.3.0/openssl.bundle
错误:执行 gem 时...(NoMethodError)
nil:NilClass 的未定义方法 'invoke_with_build_args'
我已经尝试了一些修复:
根据此答案尝试了 gem update --system
bundle install fails with SSL certificate verification error但在该命令上出现相同的错误。
针对这个问题尝试了 brew install openssl
然后是 brew link openssl --force
但无济于事:OpenSSL error installing ruby 2.0.0-p195 on Mac with rbenv
甚至尝试重新安装 rbenv 和 ruby,但也没有用,仍然出现相同的错误。
最佳答案
这个错误中执行的Ruby不是rbenv
安装的,而是Homebrew安装的。
如果您正在尝试使用 rbenv
,可以运行 brew uninstall ruby
和/或检查 echo $PATH
的输出以进行确保 ~/.rbenv/shims
在开头。
关于ruby - 由于使用 rbenv 的 ssl 无效导致 Gem 安装错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26209977/