June 6, 2008

Ruby, Ruby, Ruby

I formatted my OS partition and re-installed Vista a month or so ago. At the same time, I did a complete overhaul of my old applications partition and removed a lot of folders/apps that I had had installed that I hadn’t used in a long time. Ruby was one of those folders to go since I don’t do much Ruby development. However, I wanted to re-install Ruby yesterday because I wanted to test out the latest crop of Ruby IDEs. But would you believe that there appear to be no instructions anywhere on how to install Ruby on Windows manually?

Most other languages/compilers at least have a text file which describes how to set it up under most of the major platforms. But Ruby simply says something along the lines of "if you don’t know how to set Ruby up manually, then you shouldn’t be trying to do so. Instead, use the one-click installer." Wherever I looked for help on installing Ruby manually under Windows, all I saw were references to the one-click installer. No info on how to do the deed yourself if you wanted a svelte and compact installation that had just the bits you wanted.

So I decided to try it myself 🙂 And here are the steps in case somebody else is looking to find out how to install Ruby manually under Windows.

  1. Download the Ruby binary ZIP file from the Ruby site’s download page. At the moment, the latest stable appears to be 1.8.7 and the development version is 1.9.0. But this will of course change.
  2. Extract the ZIP file (keeping the folder structure intact) to the folder where you want Ruby installed. In my case, I extracted everything to D:\Ruby.
  3. Add the Ruby bin folder (in my case, D:\Ruby\bin) to your system path.
  4. Download zlib for Windows from the site and copy the zlib1.dll (from the bin folder inside the ZIP file) as zlib.dll (the renaming is important) to either your Ruby bin folder or to your Windows system folder. (I believe it just needs to be in your system path somewhere).
  5. Download iconv from the Sourceforge site and add the iconv.dll file (from the bin folder inside the ZIP file) again to your Ruby bin folder or to your Windows system folder.
  6. Now download RubyGems to add gems support to your installation of Ruby. You can either download the ZIP file or get the .gem file but my instructions are for working with the ZIP file since there is no .gem support in the installation of Ruby we’ve done 🙂
  7. Extract the RubyGems ZIP file to a temporary folder.
  8. Open a command prompt, change the folder to the temporary folder from step #7 above and run the following command:
    ruby setup.rb
  9. Once the gems installation completes successfully, you can remove the temporary folder and your Ruby installation should be ready 🙂
Tags: , ,
Posted by Fahim at 6:23 am  |  No Comments