gem install fails with openssl failure

后端 未结 11 1052
花落未央
花落未央 2020-12-07 07:51

I tried to install cocoapods (http://cocoapods.org/) on my OSX Mountain Lion.

 moshe-mbp:~ moshem$ gem install cocoapods
 ERROR:  Could not find a valid gem          


        
相关标签:
11条回答
  • 2020-12-07 08:27

    Current release of rvm does a lot better job handling this things, run:

    rvm get head
    rvm reload
    rvm autolibs enable
    rvm reinstall 1.9.3 --disable-binary
    

    Make sure to follow any displayed instructions - it's all there to help you.

    0 讨论(0)
  • 2020-12-07 08:31

    If you are in China

    0 讨论(0)
  • 2020-12-07 08:36

    This is fixed by avoiding https and using the insecure http instead. Running this worked for me.

    gem source -a http://rubygems.org/
    
    0 讨论(0)
  • 2020-12-07 08:36

    I fixed it by only appending to the PATH variable in my ~/.bash_profile, which in my case meant changing

    export PATH="/usr/local/mysql/bin:$PATH"
    export PATH=$M2:$PATH
    export PATH=$JAVA_HOME/bin:$PATH
    

    to

    export PATH="$PATH:/usr/local/mysql/bin"
    export PATH=$PATH:$M2
    export PATH=$PATH:$JAVA_HOME/bin
    

    In terminal, type nano ~/.bash_profile to start editing.

    0 讨论(0)
  • 2020-12-07 08:38

    Try using http://rubygems.org/ (without SSL) as a source — that fixed the error for me.

    gem source -r https://rubygems.org/
    gem source -a http://rubygems.org/
    gem install cocoapods
    
    0 讨论(0)
  • 2020-12-07 08:39

    You can try to update OpenSSL from source instead:

    curl -L -O http://www.openssl.org/source/openssl-1.0.1b.tar.gz.asc
    curl -L -O http://www.openssl.org/source/openssl-1.0.1b.tar.gz
    gpg --verify openssl-1.0.1b.tar.gz.asc
    tar xvzf openssl-1.0.1b.tar.gz
    cd openssl-1.0.1b
    perl ./Configure shared zlib --prefix=/opt/local darwin64-x86_64-cc
    make
    make test
    sudo make install
    

    source

    0 讨论(0)
提交回复
热议问题