$ sudo gem install cocoapods -n /usr/local/bin
ERROR: SSL verification error at depth 3: certificate has expired (10)
ERROR: Certificate /O=Digital Signature Trust Co./CN=DST Root CA X3 expired at 2021-09-30T14:01:15Z
ERROR: SSL verification error at depth 3: certificate has expired (10)
ERROR: Certificate /O=Digital Signature Trust Co./CN=DST Root CA X3 expired at 2021-09-30T14:01:15Z
ERROR: SSL verification error at depth 3: certificate has expired (10)
ERROR: Certificate /O=Digital Signature Trust Co./CN=DST Root CA X3 expired at 2021-09-30T14:01:15Z
ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why:
Unable to download data from https://gems.ruby-china.com - SSL_connect returned=1 errno=0 state=error: certificate verify failed (certificate has expired) (https://gems.ruby-china.com/specs.4.8.gz)
ERROR: SSL verification error at depth 3: certificate has expired (10)
ERROR: Certificate /O=Digital Signature Trust Co./CN=DST Root CA X3 expired at 2021-09-30T14:01:15Z
ERROR: SSL verification error at depth 3: certificate has expired (10)
ERROR: Certificate /O=Digital Signature Trust Co./CN=DST Root CA X3 expired at 2021-09-30T14:01:15Z
下载 new CA certificate 后 替换 /usr/local/etc/openssl/cert.pem
, 注意要重命名一下下载文件。
然后执行一下一下命令:
$ sudo rm /etc/ssl/cert.pem
$ sudo ln -s /usr/local/etc/openssl/cert.pem /etc/ssl/cert.pem