首頁  >  問答  >  主體

openssl - win7下安裝sass失敗,提示ruby憑證不對?

步驟:
1.

gem sources --remove https://rubygems.org/

2.

gem sources -a https://ruby.taobao.org/
Error fetching https://ruby.taobao.org/:
        SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: ce
rtificate verify failed (https://rubygems-china.oss-cn-hangzhou.aliyuncs.com/spe
cs.4.8.gz)

3.

gem sources -l
*** CURRENT SOURCES ***

問題來源:
http://stackoverflow.com/questions/4528101/ssl-connect-returned-1-errno-0-state-sslv3-read-server-certificate-b-certificat

https://gist.github.com/fnichol/867550

I had this same issue while working on a Ruby project. I am using Windows 7 64bit.

I resolved this by:

Downloading the cacert.pem file from http://curl.haxx.se/ca/cacert.pem.
Saved that file to C:/RubyCertificates/cacert.pem
Then set my environmental variable "SSL_CERT_FILE" to "C:/RubyCertificates/cacert.pem"
source: https://gist.github.com/fnichol/867550

證書網址:http://curl.haxx.se/ca/cacert.pem

依照上面這位網友的方法配置了環境變數如下圖

再執行gem sources -a https://ruby.taobao.org/
報錯依舊

有誰遇過,還是我的環境變數沒有配置對呢?

PHP中文网PHP中文网2710 天前745

全部回覆(4)我來回復

  • ringa_lee

    ringa_lee2017-04-24 09:14:42

    現在淘寶的gem停止更新維護了,目前是ruby-china維護。
    gem source --remove https://ruby.taobao.org/ --add http://gems-china.org/

    回覆
    0
  • PHP中文网

    PHP中文网2017-04-24 09:14:42

    gem source --add http://rubygems.org/
    gem source -l

    回覆
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-24 09:14:42

    遇到相同問題,依照https://gist.github.com/fnichol/867550 的步驟執行後順利通過(需要註銷機子)。
    不過我是加到系統變量,不知道是不是這個原因。

    回覆
    0
  • PHP中文网

    PHP中文网2017-04-24 09:14:42

    要加入系統變量,重啟電腦再執行切換淘寶源的指令就可以了

    回覆
    0
  • 取消回覆