gem install fails with openssl failure

后端 未结 11 1085
花落未央
花落未央 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:43

    You can first install a newer openssl, as Mike Slutsky described. To check your openssl version:

    $ openssl version
    

    Get a more recent one here: http://www.openssl.org/source/ Then configure and install it:

    $ cd openssl-1.0.1f_src/
    $ ./Configure --prefix=/Users/me/bin/openssl-1.0.1f_bin darwin64-x86_64-cc
    $ make install
    

    Now configure ruby with this openssl:

    $ cd ruby-2.1.0_src/
    $ ./configure --with-openssl-dir=/Users/me/bin/openssl-1.0.1f_bin --prefix=/Users/me/bin/ruby-2.1.0_bin
    

    Note: the new openssl does not need to be on you $PATH. This worked for me with ruby 2.0 and 2.1. Good luck (-:

提交回复
热议问题