Curl Certificate Error when Using RVM to install Ruby 1.9.2

前端 未结 11 1434
太阳男子
太阳男子 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:53

    Thank you Dorothy - this recipe worked for me with the following minor modifications for a Win7 environment:

    For others with this issue -

    1. Appreciate the discussion about updating the CA_Bundle - Good to do but it didn't help with this issue - the pyyaml website cert will still cause CURL to throw an error and since CURL is launched within the installer, no way to add a -k option.

    2. Ruby 1.9.2-p290 is trying to install YAML 0.1.4 so Google for a mirror and download that version - YAML-0.1.3 will have no effect in bypassing the issues.

    3. You need to do the windows equivalent of CHMOD 777 - within the rvm/src folder to the extracted files. Change security so that everyone has ownership/all privileges and turn off the read-only attribute for all files and folders.

    The installer will still throw errors when it tries to download (CURL error), but will resume by trying to extract. The extraction will throw errors because the tarball is already extracted to the src folder. The next step of configuring YAML should work without errors if permissions in step 3 were set correctly and the installation should complete without further problems. (If installing via cygwin/bash, you will need to add a C compiler like 'gcc' and add 'ncurses' (tput command) and 'make' to the default core cygwin setup options.)

    0 讨论(0)
  • 2020-11-27 10:54

    Perhaps all these complicated solutions were once necessary, but now all you need to do is first upgrade RVM and your problem will be solved:

    $ rvm get stable
    $ rvm reload
    $ rvm install ruby-1.9.3-p194
    
    0 讨论(0)
  • 2020-11-27 10:59

    If you don't mind disabling certificate check in curl (I don't):

    echo insecure > ~/.curlrc
    
    0 讨论(0)
  • 2020-11-27 11:01

    Curl is invoked in .rvm/scripts/fetch, which by default will be in your home directory.

    Edit this using your favourite text editor: for example,

     nano ~/.rvm/scripts/fetch
    

    In lines 56 and 58 (may vary with other versions of RVM, of course) you'll see two lines which begin

     fetch_command="curl ...
    

    Simply add -k after curl, save and try again.

    0 讨论(0)
  • 2020-11-27 11:06
    $ sudo apt-get install curl
    
    $ curl -L https://get.rvm.io | bash -s stable --ruby   with ruby
    
    $ curl -L https://get.rvm.io | bash -s stable --rails   with rails
    
    0 讨论(0)
提交回复
热议问题