I recently got a new MacBook Pro running Snow Leopard. I mostly got everything working the way I wanted it, but I found that the default Ruby installation is now 1.8.7, which doesn’t work for us – because we use WSS4R which is only compatible up to 1.8.6 (I wish this weren’t so, hoping to persuade the maintainer to patch and upgrade)
So I decided to download the source for Ruby 1.8.6 and install it in /usr/local – adapting very helpful instructions found on Hivelogic here
It turns out though that you can’t compile versions of Ruby pre 1.8.7p72 on Snow Leopard. I ran into this error on my new laptop and also on a colleague’s older one which he had upgraded with a Snow Leopard upgrade disc. When running make, the following error is thrown:
In file included from openssl_missing.c:22:
openssl_missing.h:119: error: conflicting types for 'BN_rand_range'
/usr/include/openssl/bn.h:411: error: previous declaration of 'BN_rand_range' was here
openssl_missing.h:120: error: conflicting types for 'BN_pseudo_rand_range'
/usr/include/openssl/bn.h:412: error: previous declaration of 'BN_pseudo_rand_range' was here
make[1]: *** [openssl_missing.o] Error 1
make: *** [all] Error 1
There are quite a few hits on this on Google, mainly relating to various Linux distros. Based on this Gentoo patch I figured you need to download the Ruby 1.8.7p72 tarball, and copy the following files from it to your 1.8.6 source:
(all subdirectories relative to the source root)
/ext/openssl/extconf.rb
/ext/openssl/openssl_missing.c
/ext/openssl/openssl_missing.h
/ext/openssl/ossl_hmac.c
Having done that I reran the ./configure, and then tried make again – and it worked.
No idea what the patched files do, but all seems stable so far.
March 26, 2010 at 3:21 pm |
Just what I needed. Thanks
April 2, 2010 at 10:00 pm |
Thank you, it worked like a charm
October 26, 2010 at 12:16 pm |
+1. Thanks for documenting this.
July 26, 2012 at 7:41 pm |
Thanks, this helped me out on an old Linux kernel (SLES 9 SP4) that I had to compile ruby 1.8.6 on.