troubles with RVM and OpenSSL

后端 未结 12 2313
暗喜
暗喜 2020-12-08 01:32

Trying to set up a new macbook for a colleague. Not going well.

First I install OpenSSL:

Heathers-MacBook-Pro:~ heather$ rvm pkg install openssl
F         


        
相关标签:
12条回答
  • 2020-12-08 01:39

    It's well described on ArchLinux wiki:

    Ruby versions older than 2.4 require OpenSSL 1.0 but RVM will try to build them with OpenSSL 1.1.

    So you can do (easiest):

    $ rvm pkg install openssl
    $ rvm reinstall 2.3.5 --with-openssl-dir=$HOME/.rvm/usr
    

    You can see more solutions on ArchLinux wiki.

    0 讨论(0)
  • 2020-12-08 01:40

    Here's how I installed rvm and ruby 2.3 on a mac with Catalina. The version of rvm installed was 1.29.9. OpenSSL 1.0.2 (downgrade) had to be installed. Note the "ipv4" in the gpg command.

    gpg --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
    \curl -sSL https://get.rvm.io | bash -s stable
    

    Download openssl 1.0.2 at https://www.openssl.org/source/

    tar -xzf openssl-1.0.2t.tar.gz
    cd openssl-1.0.2t
    ./Configure darwin64-x86_64-cc --prefix=/usr/local/opt/openssl@1.0
    make
    make test
    sudo make install
    
    rvm install 2.3.3 --with-openssl-dir=/usr/local/opt/openssl@1.0
    ruby -v
    ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'              
    >> OpenSSL 1.0.2t  10 Sep 2019
    
    0 讨论(0)
  • 2020-12-08 01:42

    For older version of ruby 2.2.10 on MacOS High Sierra 10.13.6 the only thing worked for me was:

    1. switching to older OpenSSL version
    brew switch openssl 1.0.2s
    
    1. Than reinstalling ruby using --with-openssl-dir
    rvm reinstall 2.2.10 --with-openssl-dir=/usr/local/Cellar/openssl/1.0.2s
    
    0 讨论(0)
  • 2020-12-08 01:47

    Installing Ruby 2.2 on macOS Mojave (10.14.2) with Homebrew.

    Install Homebrew

    brew install openssl
    rvm install 2.2 --with-openssl-dir=/usr/local/opt/openssl
    

    Don't use rvm pkg it's deprecated, use rvm autolibs enabled.

    0 讨论(0)
  • 2020-12-08 01:47

    For those who have issue with openssl 1.1 and Ruby 2.3 via RVM on Mac Mojave, you could try following commands. The problem is Ruby 2.3 is not compatible with openssl 1.1

    rvm pkg install openssl
    PKG_CONFIG_PATH=$HOME/.rvm/usr/lib/pkgconfig rvm reinstall 2.3.3 --with-openssl-dir=$HOME/.rvm/usr
    
    0 讨论(0)
  • 2020-12-08 01:50

    On MacOS 10.12.2 installing openssl via brew, won't work. To fix it, run:

    export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig:/usr/local/lib/pkgconfig
    

    And then install Ruby via rvm.

    EDIT: More information about the reason behind the problem here.

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