Thin With SSL on El Capitan
Hit a bug, couldn’t find the answer, documenting it here for the next person.
I’m working on a Rails project where I need SSL in development. The simple way to do this is with the thin gem for example http://www.railway.at/2013/02/12/using-ssl-in-your-local-rails-environment/
It had been working (on OS X El Capitan), but suddenly thin
started
blowing up on me, either the server wouldn’t start with:
1 2 3 |
|
Or the server would start but would blow up on HTTPS requests:
1 2 |
|
Googling returned nothing of use. (Hopefully it now returns this post.) Given the stack trace, I suspected the problem was with eventmachine. Eventmachine was a pain to build on El Capitan because Apple stopped shipping open SSL headers. I’d previously gotten it to build with:
1
|
|
however, the current best advice on building it on El Capitan has changed to:
1
|
|
(This presumes you have installed OpenSSL with Brew. If you have a different version of OpenSSL, you’ll need to change that path.)
Rebuilding thusly fixed thin
. I’m back in business and perhaps you
are as well.
I haven’t dug into why it works. My best guess is the issue is a conflict between the OpenSSL library Apple ships and the headers that come with Brew. But works is good enough at the moment.