ruby - 由于使用 rbenv 的 ssl 无效导致 Gem 安装错误

标签 ruby ssl rubygems homebrew

我正在尝试安装一个新的 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/

相关文章:

ruby-on-rails - 其中 dispatch.fcgi 提供与 "rackup"相同的行为

python - 如何使用Python API为应用服务上传和配置SSL证书

node.js - 如何在 node.js 中使用 wosign 的 SSL 证书

ruby - 在 openSUSE 11.3 上安装 RMagick - gem 无法构建其扩展

ruby - gemspec 中的私有(private) gem

ruby - 命令行界面助手?

ruby-on-rails - ruby rails :Is it possible to overload index method in ActionController?

mysql - 将复杂连接更改为 Sequel 关联

java - cmd 无法识别 ssl 连接证书

ruby - 深度 0 处的 SSL 验证错误 : unable to get local issuer certificate (20)