I'm using a MinGW64-MSys2 environment. When I try to install a package with gem install <package name>
I get something like this SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/latest_specs.4.8.gz)
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Depends on what shell you use msys or mingw* and what ruby you use you need install ca-certificates package:
pacman -S mingw-w64-i686-ca-certificates
or
pacman -S mingw-w64-x86_64-ca-certificates
or
pacman -S ca-certificates
回答2:
Try downloading the http://curl.haxx.se/ca/cacert.pem
certificate. Then, point a special environment variable to it like that: export SSL_CERT_FILE=~/cacert.pem
After that, issue an update command: gem update --system
The problem should be solved after that. Relaunch the console and continue your work.