Over the passed few days I have had a few computer troubles to say the least. After wiping my computer I decided to upgrade to El Capitan. All was well until I needed to install and link openssl for some needed gems in a ruby project.

The install worked fine…

$ brew install openssl

Then I went to link it, and thats were the issues started.….

$ brew link --force openssl
Warning: Refusing to link: openssl
Linking keg-only openssl means you may end up linking against the insecure,
deprecated system OpenSSL while using the headers from Homebrew's openssl.
Instead, pass the full include/library paths to your compiler e.g.:
-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib

This article goes more into depth of why the issue occurs. But I am just here to help provide a solution. The reason I am writing this article is because I combed through upwards of a hundred Github issues, Stackoverflow questions, technical articles, etc. and could not find a single solution. But then I found one hidden away in a Github thread that worked! So I wanted to share it here so it was more accesible.

The solution is to create a symlink to manualy link your openssl. The comment was found in this thread by @chenyoufu


After installing openssl with homebrew, create this symlink below, where {version} is the version of openssl you downloaded, for example 1.0.2c

ln -s /usr/local/Cellar/openssl/{version}/include/openssl /usr/bin/openssl

A few notes:

For 10.12.2 you will get…(and maybe this should help)
ln: /usr/bin/openssl: Operation not permitted

Openssl could be in /usr/bin/openssl or /usr/local/include/openssl so check before running the link and put in the correct location

After that just make sure to open a new shell to test and all should be good :)

CTO and Co-Founder of kopa.co | UWaterloo Alum, YC Alum

CTO and Co-Founder of kopa.co | UWaterloo Alum, YC Alum