windows环境下的rubygem配置记录

安装记录

  1. Ruby语言环境安装
  2. Gem安装
  3. 使用国内源:

    gem sources --remove https://rubygems.org/ 删掉原来的源

    gem sources -a http://gems.ruby-china.org/ 添加新源

    gem sources -l 查看现有的源

遇到问题

Q:添加新源时遇到SSL验证错误

 ERROR:  SSL verification error at depth 1: unable to get local issuer certificate (20)
    ERROR:  You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local trusted store
    Error fetching https://gems.ruby-china.com/:
    SSL_connect returned=1 errno=0 state=error: certificate verify failed (https://gems.ruby-china.com/specs.4.8.gz)

A:在**这里**下载文件,放到C盘的Ruby安装目录下,cmd设置路径:

set SSL_CERT_FILE=C:ruby路径cacert.pem