shared items

Thursday, October 8, 2009

Ruby 1.8 missing lib ( SSLEAY.dll , ZLIB.dll)

Update: There is a new effort to create a decent Windows Ruby installer. You can get the new downloadable installers from http://rubyinstaller.org/downloads/ though as of August 2009 these are still in preview form. It seems from my brief experiment that you'll still have to set your PATH manually, as per my manual instructions below. This installer also promises a faster Ruby as it builds using superior tools, so might well be worthwhile if only for that. Below are my original manual instructions for installing Ruby on Windows, which should still be just as valid as they always were. The installer is probably worth a look though.

The following worked for me on Windows XP, but maybe I'm yet to run into problems I don't know I've got:

* Download the Windows binary release from http://www.ruby-lang.org/en/downloads/
* Unzip it, in my case to C:\ruby191\
* Also download readline.dll (e.g. from http://www.econsultant.com/dll-database-r/readline.dll-download.html) and put the DLL in C:\ruby191\bin
* Put C:\ruby191\bin and C:\ruby191\lib on your PATH

That got ruby working in a basic sense for me, but I wasn't able to install gems. If I tried, I got two errors in sequence: "The ordinal 277 could not be located in the dynamic link library SSLEAY32.dll" and "This application has failed to start because zlib.dll was not found."


The ssleay32.dll problem was solved by getting hold of a couple of DLLs and putting them in the right place, as follows:

* Download "Win32 OpenSSL v0.9.8k Light" from http://www.slproweb.com/products/Win32OpenSSL.html.
* Run the installer, but take note of the following:
* You can ignore any initial warning about not having Microsoft Visual C++ 2008 Redistributables.
* You can ignore any warnings about command prompts being open.
* Install to somewhere like C:\OpenSSL - it doesn't really matter, we just need a couple of DLLs.
* When prompted, choose to Copy OpenSSL DLLS to The OpenSSL binaries (/bin) directory.
* Once the installer has completed, you can go to C:\OpenSSL\bin (or wherever you installed it) and copy the two files ssleay32.dll and libeay32.dll to your Ruby bin directory, C:\ruby191\bin in my case.

The zlib.dll problem was solved by in much the same way:

* Download the compiled zlib 1.2.3 DLL from http://www.zlib.net/ (about two thirds of the way down the page).
* Unzip it to get the zlib1.dll file.
* Put that file in your Ruby bin directory, but rename it to zlib.dll

Et voila - gems can now be installed successfully! Note that you may have had copies of some of these DLLs in your \WINDOWS\system32 directory already (I certainly did) but the problem is that they are too old. I prefer to put the newer ones directly in the Ruby bin directory, so only Ruby picks them up and it can't break anything else on the system.

http://alwaysthecritic.typepad.com/atc/2009/03/install-ruby-191-on-windows.html

1 comment:

MR said...

Thanks a lot, hint with SSL was very helpful!