在全新MacBookPRO M1上运行"gem-install-bundler"时发生SSL验证错误



在我的新MacBook Pro M1 2021上成功安装了asdf install ruby 2.6.6,并尝试运行gem install bundler,但得到了这个:

MacBook-Pro ~ % gem install bundler                                                           
ERROR:  SSL verification error at depth 1: unable to get local issuer certificate (20)
ERROR:  You must add /OU=GlobalSign Root CA - R3/O=GlobalSign/CN=GlobalSign to your local trusted store
ERROR:  SSL verification error at depth 1: unable to get local issuer certificate (20)
ERROR:  You must add /OU=GlobalSign Root CA - R3/O=GlobalSign/CN=GlobalSign to your local trusted store
ERROR:  SSL verification error at depth 1: unable to get local issuer certificate (20)
ERROR:  You must add /OU=GlobalSign Root CA - R3/O=GlobalSign/CN=GlobalSign to your local trusted store
ERROR:  Could not find a valid gem 'bundler' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate) (https://rubygems.org/specs.4.8.gz)
ERROR:  SSL verification error at depth 1: unable to get local issuer certificate (20)
ERROR:  You must add /OU=GlobalSign Root CA - R3/O=GlobalSign/CN=GlobalSign to your local trusted store
ERROR:  SSL verification error at depth 1: unable to get local issuer certificate (20)
ERROR:  You must add /OU=GlobalSign Root CA - R3/O=GlobalSign/CN=GlobalSign to your local trusted store

我试图打开Mac的Keychain Access窗口,并为每个GlobalSign证书指定Always Trust选项,但没有成功。

OS: MacOS Monterey 12.0.1

ruby -v: 2.6.6

gem -v: 3.0.3

Homebrew: 3.3.4

我也遵循了该指南,遇到了这个问题。试试这个:检查目录/opt/homebrew/etc看看你有没有openssl@1.1如果没有,您可能需要使用brew reinstall openssl@1.1重新安装。openssl1.1是我在ruby 2.6.5中使用的,您可能需要为您的ruby版本检查它。

此外,我还不完全确定这一点,但在本指南之后,我还在~/zshrc文件中添加了几个env变量。请确保您正在更改";openssl@1.0"至";openssl@1.1"或者你的ruby版本使用的任何东西。

相关内容

  • 没有找到相关文章

最新更新