Date
Jul. 21st, 2024
 
2024年 6月 16日

Post: SSL: certificate verify failed

SSL: certificate verify failed

Published 12:09 Sep 22, 2016.

Created by @ezra. Categorized in #Programming, and tagged as #Ruby.

Source format: Markdown

Table of Content

今天在虚拟机里安装 CocoaPods 的时候,偶然遇到一个问题:

$ gem install cocoapods
ERROR:  Could not find a valid gem 'cocoapods' (>= 0), here is why:
          Unable to download data from https://ruby.taobao.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://ruby.taobao.org/specs.4.8.gz)

想起来刚在虚拟机里安装了 RVM,那既然说是 certificate 问题的话,而且我们知道 OS X 默认的 OpenSSL 版本比较低,RVM 又安装了新的版本,甚至 RVM 还允许指定版本。

所以:

rvm osx-ssl-certs update all

成功解决。

(参见 RVM.io)

但需要注意的是,如果你在使用 Ruby 2.2.x 的版本,你有可能需要重新安装这个版本才能解决,例如:

rvm reinstall 2.2.2 --disable-binary

Pinned Message
HOTODOGO
I'm looking for a SOFTWARE PROJECT DIRECTOR / SOFTWARE R&D DIRECTOR position in a fresh and dynamic company. I would like to gain the right experience and extend my skills while working in great teams and big projects.
Feel free to contact me.
For more information, please view online résumé or download PDF
本人正在寻求任职 软件项目经理 / 软件技术经理 岗位的机会, 希望加⼊某个新鲜⽽充满活⼒的公司。
如有意向请随时 与我联系
更多信息请 查阅在线简历下载 PDF