5

I have ruby version 2.1.5 installed on my system.

On running bundle install, I am getting "Could not load OpenSSL. You must recompile Ruby with OpenSSL support or change the sources in your Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL using RVM are available at http://rvm.io/packages/openssl."

My Gemfile has soures with http only.

On executing "rvm pkg install openssl" : ==> Formulae curl-openssl glib-openssl openssl@1.1 ✔ homebrew/portable-ruby/portable-openssl

There is no openssl@1.0 and openssl

How to degrade to openssl@1.0 from 1.0.

Already tried rvm reinstall 2.1.5 --with-openssl-dir=brew --prefix openssl@1.0 But it is of no use for me.

RB19
  • 169
  • 2
  • 10
  • 2.1.5 is no longer supported so it could take some trickery to get it working. Only 2.4 through 2.6 are currently maintained. Is there anything preventing upgrading? Ruby's been pretty good lately and there's usually no serious surprises. OpenSSL itself has had some *severe* security issues that make running older versions highly risky. – tadman Dec 04 '19 at 01:30
  • yes, actually we are not planning to upgrade it yet. – RB19 Dec 04 '19 at 05:08
  • See [OpenSSL 1.0.2m on macOS](https://stackoverflow.com/questions/59337838/openssl-1-0-2m-on-macos) – Cœur Dec 29 '19 at 02:24

3 Answers3

3

The previous solution doesn't work any more, I have succeeded with the following steps:

brew install rbenv/tap/openssl@1.0
ln -sfn /usr/local/Cellar/openssl@1.0/1.0.2t /usr/local/opt/openssl
Gong Pengjun
  • 971
  • 7
  • 14
2

I've seen this issue on rvm project where you can find more detail about this.

This step works for me, we have to wait for some official fix.

  1. Install openssl via rvm pkg install openssl
  2. Remove and reinstall rubies with rvm reinstall 2.1.5 --with-openssl-dir=$HOME/.rvm/usr
Horacio
  • 2,865
  • 1
  • 14
  • 24
1

I have tried the solution on Mac OS X Catalina and it works.

  1. Download the file: https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
  2. Run brew with the file downloaded:
    brew install openssl.rb
Gong Pengjun
  • 971
  • 7
  • 14