Last Updated: February 25, 2016
·
1.993K
· tadas_t

Troubleshooting Ruby 2.0 installation on OSX

If you use rbenv it should be as simple as updating rbenv and ruby-build, and running

rbenv install 2.0.0-p0 

I wasn't so lucky and had had to do some homework before I succeeded. Hopefully this post will save some time for the other unlucky ones :)

When I tried to run rbenv install 2.0.0-p0, I got something like:

    0 enumerator.so

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

make: *** [.rbconfig.time] Abort trap: 6
make: *** Waiting for unfinished jobs....
make: *** [encdb.h] Abort trap: 6

Being too lazy I tried some suggested solutions but they didn't work. Then I opened the full install log and looked up the error:

[BUG] Stack consistency error (sp: 30, bp: 28)

Unsurprisingly, someone else has solved the problem already. Using clang instead of the default C compiler gcc worked for me too

CC=clang rbenv install 2.0.0-p0 

Next, if you have problems with OpenSSL, like

SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)

You might need to update certificates in your keychain. There is a homebrew script (source):

brew tap raggi/ale
brew install openssl-osx-ca

That seemed to solve all the problems for me.