Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR: While executing gem ... (Gem::Exception) OpenSSL is not available

I get this openssl error when trying to install/update any gem, although I have openSSL installed through brew install openssl.

This can be frustrating but there is a way to address this problem.

like image 666
Karan Sapolia Avatar asked May 17 '26 12:05

Karan Sapolia


1 Answers

To address this problem, you need to:

  1. Install openssl: brew install openssl
  2. Using whatever package manager you use for ruby (rbenv, rvm, frum), reinstall the ruby version you need to work with, using the cli option for specifying the openssl directory to be used by the ruby version being installed.

For rvm that means:

rvm reinstall 2.3.0 --with-openssl-dir=`brew --prefix openssl`

For frum:

frum uninstall <ruby version>
frum install <ruby version> --with-openssl-dir=<ssl_dir> # Specify the OpenSSL directory

This guide was geared towards MacOS. Similarly, you should reinstall ruby with the right cli options on whichever operating system you are using.

like image 102
Karan Sapolia Avatar answered May 20 '26 06:05

Karan Sapolia