Gem 安装 jekyll 遇到 “certificate verify failed” 问题解决办法

问题现象

今天用 Gem 安装 jekyll 时,遇到如下错误:

C:\Users\Apple>gem install jekyll
ERROR:  Could not find a valid gem 'jekyll' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server ce
rtificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)

解决办法

  1. 下载 https://curl.haxx.se/ca/cacert.pem ,并保存到本地: C:\Ruby22-x64
  2. 添加环境变量: SET SSL_CERT_FILE=C:\Ruby22-x64\cacert.pem
  3. 重新执行安装命令:
C:\Users\Apple>gem install jekyll
Fetching: forwardable-extended-2.6.0.gem (100%)
Successfully installed forwardable-extended-2.6.0
Fetching: pathutil-0.16.0.gem (100%)
Successfully installed pathutil-0.16.0
Fetching: liquid-4.0.0.gem (100%)
Successfully installed liquid-4.0.0
Fetching: kramdown-1.15.0.gem (100%)
Successfully installed kramdown-1.15.0
Fetching: colorator-1.1.0.gem (100%)
Successfully installed colorator-1.1.0
Fetching: jekyll-3.6.2.gem (100%)
Successfully installed jekyll-3.6.2
Parsing documentation for forwardable-extended-2.6.0
Installing ri documentation for forwardable-extended-2.6.0
Parsing documentation for pathutil-0.16.0
Installing ri documentation for pathutil-0.16.0
Parsing documentation for liquid-4.0.0
Installing ri documentation for liquid-4.0.0
Parsing documentation for kramdown-1.15.0
Installing ri documentation for kramdown-1.15.0
Parsing documentation for colorator-1.1.0
Installing ri documentation for colorator-1.1.0
Parsing documentation for jekyll-3.6.2
Installing ri documentation for jekyll-3.6.2
Done installing documentation for forwardable-extended, pathutil, liquid, kramdown, colorator, jekyll after 10 seconds 6 gems installed

参考

How to solve “certificate verify failed” on Windows?

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值