Ruby 1.9 and OpenSSL on Ubuntu
Having trouble getting openssl working on your Linux box and Ruby 1.9 (or 1.9.1, specifically)? Here's something to give a try...
If you got your Ruby from a package manager, you have to get an extra package before reinstalling Ruby. If you built from source (as is currently the only way to get Ruby 1.9.1 on Ubuntu) then you still have to get the extra package, but you don't have to reinstall Ruby.
From the repository
- sudo aptitude install libopenssl-ruby1.9
- sudo aptitude install ruby1.9
From source
- sudo aptitude install libopenssl-ruby1.9
- cd ~/Downloads/ruby-1.9.1-p0/ext/openssl
- ruby extconf.rb && make && sudo make install
Note that if you haven't installed Ruby yet, you don't need to build the openssl gem manually -- I believe it will automatically get picked up during the regular Ruby 1.9.1 build process if all the dependencies are already there.
Disclaimer...
I'm not 100% sure these steps are accurate, so if they're not, please leave angry messages and I'll try to fix the directions. Otherwise, hope they help!
August 27th, 2009 - 04:15
You will also need libssl-dev ( otherwise it just won’t build from source)
October 4th, 2009 - 22:00
Hi!
I’ve got a problem when run ‘make’ in /ruby*/ext/openssl
ossl.c:118: error: expected ‘)’ before ‘*’ token
ossl.c:119: error: expected ‘)’ before ‘*’ token
make: *** [ossl.o] Error 1
How I can correct it?
October 6th, 2009 - 22:05
Hmm….no idea I’d be surprised if ossl.c actually had a syntax error. Maybe try redownloading the latest or second-latest versions?
November 26th, 2009 - 15:27
Got stuck on this whilst trying to install passenger. Thanks for the tip!
January 31st, 2010 - 12:18
Cool stuff! Thanks, you are a life saver!
February 2nd, 2010 - 12:38
Long,
theerror in ossl.c has been recently fixed in rb enterprise and was caused by openssl 1.0 release…
May 9th, 2012 - 17:46
You, My good sir, saved me after many hours of googling!!
Thank you so much!
I love blogs like these!
August 27th, 2009 - 09:25
Thanks for the tip!