I'm attempting to install jekyll
and I've encountered an error. I'm running Mac OS X 10.11.4 (El Capitan).
$gem install jekyll
ERROR : While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
$gem source -l
https://ruby.taobao.org
$which openssl
/usr/local/bin/openssl
I welcome your suggestions how to resolve this error.
You just need to set this env variables so your compiler has the correct path for openssl libs (if using Homebrew on macOS, try
brew info openssl
to see this info):Then reinstall your ruby (
rvm reinstall ruby-version
)Considering the other answers related to openssl, we can see the same error yet when we try to execute as a superuser in some cases, as follows:
Without superuser permissions, we can see a different behavior, a successful one, as follows:
Newer versions of OSX deprecated openSSL, leaving many dependencies broken. You need to reinstall ruby, but specify exactly where your openSSL libraries are. If you're using
rvm
then that looks like:If you're using homebrew, then a quick shortcut to where your libraries are is:
Method 1 (Install OpenSSL)
Type all these commands in your Terminal (OSX) just to be extra sure you've done everything:
Finally, you need OpenSSL installed before you compile Ruby before you install Jekyll (or other gems)!
Method 2 (Reinstalling Ruby)
Newer versions of OSX deprecated openSSL.
RVM with OpenSSL
With the latest RVM version
homebrew and OpenSSL