Thursday, June 25, 2009

Installing Ruby on Windows - it's all about the libraries

Ruby on windows is a bit lackluster, primarily due to the poor C compiler support making it hard to compile the source there, the documentation doesn't mention the extra libraries it requires and the fact that the One-Click-Installer is always several versions behind.

The issue here is that Ruby doesn't give you any hints as to where to find the required libraries, or even that it uses them, so installing is a bit of a trial and error affair. The other issue is that a couple of the error messages are a bit cryptic (there's one that states "Ordinal 3873 could not be located in dynamic library... that means openssl isn't installed) making it hard to pinpoint the fix.

So: The Cabin has a great tutorial (that I heartily recommend) for installing 1.9 on windows from the zipped binary distro, I found it only after I'd done most of these steps myself.
For those of you who want the Cliffs Notes version, here it is:


    Add the ruby/bin directory to your system path.

    Find zlib1.dll, libeay32.dll, libssl32.dll and readline5.dll, place them in your ruby/bin directory, they're libraries from the packages zlib, openssl and readline on http://gnuwin32.sourceforge.net

    Rename zlib1.dll to zlib.dll, libssl32.dll to ssleay32.dll and readline5.dll to readline.dll


And that's it. Installing an up to date Ruby distribution in 4 easy steps.

3 comments:

  1. Hello

    Could someone help me?

    I followed the 4-step procedure, ran the ruby interpreter and tried a simple command:

    print "Hello"

    the cursor went to the next line and then nothing at all.

    Any help would be very appreciated.

    Caio

    ReplyDelete
  2. Hello, I was working through the steps you outlines, but I can't seem to get it running. I will try again and post the error message.

    Helen

    ReplyDelete
  3. Update: It's all working great now. I have been learning quite well since I was last here.

    Nice blog BTW :)

    Helen

    ReplyDelete