Ruby on rails: how to install ruby 1.8.7 on windows 6

Posted by Randika on January 11, 2010

I couldn’t find the very famous ruby one-click-installer for ruby 1.8.7, after trying various ways I ended up with a solution for this. Here is what I did to get ruby 1.8.7 installed on windows.

First download the ruby 1.8.7 from this link: http://www.ruby-lang.org/en/downloads/ (I took Ruby 1.8.7-p72 Binary)

extract this to c:\ruby (or somewhere else you prefer but avoid using spaces on directories for your own safety)

Now update your PATH environment variable with appending c:\ruby\bin and verify the status of the installation by typing ruby -v in the command line prompt.

C:\Users\Randika>ruby -v
ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-mswin32]

Ok now we need some dependencies packages which doesn’t bundle with ruby 1.8.7

Download libiconv package from here
http://sourceforge.net/projects/gettext/files/
find the libiconv-1.9.1.bin.woe32\bin\iconv.dll and place it inside c:\ruby\bin\

Download zlib package from here
http://www.zlib.net/zlib123-dll.zip
extract it and find the zlib1.dll and place it inside inside c:\ruby\bin\

OK, now we can install rubygems
Get it from here rubygems-1.3.5.zip and extract to wherever you prefer. And then run ruby setup.rb

D:\gems\rubygems-1.3.5>ruby setup.rb

by now gems should be ready to use with. Now you can update gems with

gem update --system

finally install rails

D:\>gem install rails
.....
...
D:\>rails -v
Rails 2.3.5

UPDATE: (20100422)
There is a Release Candidate (RC) of Ruby 1.8.7 (Ruby 1.8.7-p249 (RC2)) at http://rubyinstaller.org/download.htm
You can try that instead of what I have told in this post. Anyway I didn’t try it myself yet.