This post originated from an RSS feed registered with Ruby Buzz
by Daniel Berger.
Original Post: Ruby, OpenSSL and Zlib
Feed Title: Testing 1,2,3...
Feed URL: http://djberg96.livejournal.com/data/rss
Feed Description: A blog on Ruby and other stuff.
Building Ruby on Windows manually with VC++ is pretty straightforward. The downside is that two libraries in particular, OpenSSL and Zlib, have always been a PITA to build yourself. Since Rubygems needs Zlib, and Rails needs OpenSSL, this has always been problematic.
The zlib problem has been partially solved by Zliby, a pure Ruby implementation of zlib. You can use zliby.rb (renamed to zlib.rb) for installing gems. The downside is that the GzipWriter class isn't implemented yet, so you can't yet build gems. Still, that's not an issue if don't care about building gems locally.
Building OpenSSL is trickier, but with 0.9.8i it's certainly gotten easier. They've added a Perl configure script to help Windows users out. So long as you have Perl installed (which you can grab from ActiveState) you can install OpenSSL. This is how I did it:
When you try to use the Ruby openssl bindings you might get this error:
"The ordinal 284 could not be located in the dynamic link library SSLEAY32.DLL"
The problem is that Ruby is picking up an ssleay32.dll file from another application (several apps tend to bundle it, e.g. PostgreSQL). You'll want to make sure you're using the one you just built by setting your path properly: