Installing Ruby on Rails on Windows XP


First of all, simply run the Ruby installer from the website, then download the ruby gems setup, extract all of the files, and run setup.rb - this installs gems.

I would strongly recommend rebooting at this point.

This is where I found the documentation let me down, it simply says open up a ruby console, and the default one never seems to work (Interactive Ruby Console).

So we go to our start menu, and then Ruby > RubyGems and open up the Ruby Gems Console, this gets us into a working console where we can then run

gem update –system - this checks the core ruby and gems for an update as far as i’m aware.

gem install rake - rake is ruby make, required for RoR though I didn't see it mentioned in the docs at the time ;).

gem install rails - hopefully no need to explain why :P

gem install mongrel - mongrel is a local testing server - similar to apache.

Now we are ready to start our application. In the console type:

rails myapp (change myapp to the name of your application/site)

now the command prompt shows it has installed a few default files and since I ran at C:\Ruby, the files are

located in C:\Ruby\myapp

now i’m going to start mongrel

so at the prompt I type cd myapp (since i’m already in the ruby folder)

and now the command

mongrel_rails start -d

of course being on XP I get a firewall dialogue, so I choose to allow it.

the last line when you run this command gives us the details of the server

**Mongrel 1.1.5 available at

so to access our server we simply type in http://localhost:3000

and you should see your ruby on rails enviroment all ready to use! (you need to keep that console open unless you install the mongrel service)

To run mongrel as a service

gem install mongrel_service

then :

mongrel_rails service::install -N MyAppsServiceName -c c:\Ruby\myapp\ -p 4000 -e production

the -N gives the service a custom name, so if you needed to ctrl-alt-del that’s the name that would appear

the -c is the change to directory - basically where you want your scripts to start from, aka the myapp folder

the -p is the portand the -e is the mode you want to run it in.

assuming this has worked correctly you can click start>run type “services.msc” scroll down the list and

find your app, right click it and start the service, you can now open up the port you specified in your

browser and all should be swell

Not quite as easy as the initial documentation suggested but I got there in the end..