【问题标题】:SSL verification error when running `gem install bundler` on fresh MacBookPRO M1在新的 MacBookPRO M1 上运行“gem install bundler”时出现 SSL 验证错误
【发布时间】:2022-01-01 02:01:22
【问题描述】:

在我新的 MacBook Pro M1 2021 上成功安装 this post 之后的 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

【问题讨论】:

  • 你解决过这个问题吗?

标签: ruby-on-rails ruby ssl bundler apple-m1


【解决方案1】:

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

此外,我对此并不完全确定,但我还在 guide 之后的 ~/zshrc 文件中添加了几个 env 变量。确保您将“openssl@1.0”更改为“openssl@1.1”或您的 ruby​​ 版本使用的任何内容。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-10-31
    • 1970-01-01
    • 2013-05-02
    • 1970-01-01
    • 1970-01-01
    • 2023-04-11
    • 1970-01-01
    相关资源
    最近更新 更多