Brew, rvm, and openssl


(Sam Skinner) #1

For the past six months or so, I have been fighting with homebrew, rvm and openssl. I frequently am unable to run “gem install XX” getting the error: “Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources”.

I installed openssl with brew (“brew install openssl”) and had to set the LDFLAGS and CPPFLAGS. That got it working. However, when I ran ‘rvm requirements’, rvm installed a different version of openssl and now everything is broken. I tried running ‘rvmreinstall 2.4.1 --with-openssl-dir=/usr/local/opt/openssl’ but that throws the following error: “Error running ‘__rvm_make -j 1’,”.

I am sure this looks like an rvm issue, but I am placing this here because it appears homebrew and rvm want to require different versions of openssl and the two requirements are conflicting.

Any one else dealing with this problem?

I am on a Mac using Sierra (10.12.4) with up-to-date versions of homebrew and rvm.

Thanks,


(Franklin Yu) #2

I don’t think Homebrew “requires” an OpenSSL version. RVM requires an OpenSSL version which Homebrew provides.


(Sam Skinner) #3

I think you are right because even when I delete all versions of openssl, Homebrew itself still works. However, when I run ‘brew install openssl’, I have to set LDFLAGS and CPPFLAGS to get it to work. And it still does not work for rvm. If I run ‘rvm requirements’, rvm adds its own version of openssl and now neither version of openssl works.

I am not understanding which version of openssl to use and how to make it work across both Homebrew (e.g., for ‘gem install X’) and RVM.

Thanks for your comment!

Sam


(Franklin Yu) #4
  1. IIRC, RVM should be able to add LDFLAGS and CPPFLAGS itself; no need to provide these two variables as environment variables to RVM.
  2. This issue might help you debug.