This post originated from an RSS feed registered with Ruby Buzz
by Daniel Berger.
Original Post: Building openssl for Ruby with Visual Studio
Feed Title: Testing 1,2,3...
Feed URL: http://djberg96.livejournal.com/data/rss
Feed Description: A blog on Ruby and other stuff.
Yet another "how to build" post mostly for my own reference, but you may find it useful.
Building the openssl lib for Ruby with Visual Studio is a bit of a pain. First, you'll need to install openssl itself (which you can build from source if you have Perl installed) or use their precompiled stuff. To build openssl itself from source, do this:
This assumes a 32-bit build, but you get the idea. Once that's done, you'll need to cd to the ext/openssl directory of wherever your Ruby source code is. Before you begin you will need to hand edit the extconf.rb file and change line 40 from "if $mingw" to "if File::ALT_SEPARATOR". This ensures that the gdi and wsock32 libs are linked properly.
With that done, run "ruby extconf.rb --with-openssl-dir=c:/usr/local", or wherever you installed openssl. Once that's complete you have to pause again and hand edit the generated Makefile because it's missing a declaration for $(top_srcdir). Look near the bottom and you'll see this line:
Then run "nmake" followed by "nmake install". Once that's done you can test it out by firing up irb and typing 'require "openssl"' to ensure you don't get an error.