Curl Certificate Error when Using RVM to install Ruby 1.9.2

前端 未结 11 1548
太阳男子
太阳男子 2020-11-27 10:29

RVM is running into a certificate error when trying to download Ruby 1.9.2. It looks like curl is having a certificate issue but I am not sure how to bypass it

11条回答
  •  天涯浪人
    2020-11-27 10:39

    If do not want to change the script AND you do not want to add a cert "for ever" to the cert bundle. There is a very nice and quick solution:

    #to download the cert
    wget http://curl.haxx.se/ca/cacert.pem
    #to let curl use it for the next calls
    export CURL_CA_BUNDLE=~/cacert.pem
    

    Then run your script. To reset the environment variable (for subsequent script calls that should not use this cert) re-login to your system or unset the environment variable:

    export CURL_CA_BUNDLE=
    

提交回复
热议问题