2

Since I upgraded to OS X 10.10 Yosemite, I get the following error when trying to install a ruby gem:

ERROR:  While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources

But when I do which openssl it shows me the path:

/usr/local/bin/openssl

I have uninstalled and reinstalled rvm and ruby but still get the same error.

How do I install Ruby gems?

jww
  • 97,681
  • 90
  • 411
  • 885
jdeleon
  • 63
  • 2
  • 7
  • Have you tried this: http://stackoverflow.com/questions/26639691/ruby-openssl-install-on-mac-10-10-yosemite – Florent Ferry Jun 14 '15 at 08:29
  • Possible duplicate of [Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources](http://stackoverflow.com/questions/37336573/unable-to-require-openssl-install-openssl-and-rebuild-ruby-preferred-or-use-n) – Meekohi Feb 15 '17 at 14:00

2 Answers2

1

OpenSSL issues with Ruby on Yosemite could be a result of your installed version of Ruby trying to locate OpenSSL certificates in /etc/openssl/certs instead of its new location at /usr/local/etc/openssl/certs. Try reinstalling ruby using the --disable-binary switch so that the source is re-built on your local machine instead of using the pre-compiled binary. For example:

rvm uninstall 2.2.0
rvm install 2.2.0 --disable-binary
Ryan H.
  • 7,374
  • 4
  • 39
  • 46
1

Looks like the gem installer can't find your openssl.

Try this with your ruby version:

brew install openssl
rvm reinstall 2.3.4 --with-openssl-dir=`brew --prefix openssl`
rajat banerjee
  • 1,256
  • 2
  • 12
  • 21