Trying Rails on Microsoft Windows 1
Many people I speak to are put off trying Ruby on Rails because they think it will be too difficult to install. These are Windows developers, used to the convenience of Microsoft Visual Studio.
Luckily, it isn’t difficult at all.
This article will guide you through a few basic steps that will give you a fully operational Ruby, Rails and MySQL environment. I’ll also give you some hopefully useful tips and quick examples for common tasks.
The last thing I will do is introduce you to RadRails - my IDE of choice for Rails development.
What I certainly won’t do in this article is teach you anything about Ruby on Rails. For that, I recommend a magnificent book called “Agile Web Development with Rails”. In fact, this guide should be considered as nothing more than a humble companion to that book.
Downloads
I suggest you download the following packages:
Those links point directly at the current release of the programme, rather than the download page. This means that the links may expire or become outdated - I’ll try and keep this page up to date, but be aware that new versions might be available. You should run the installers for 7-Zip and the MySQL Tools.
Instant Rails
Instant Rails is a most handy package. It contains a pre-built installation of several key services and applications that can be run from a single, totally self-contained directoy.
I strongly suggest that you use 7-zip to extract the InstantRails folder. There are a lot of files in there, and the built-in Windows zip handling makes a bit of a meal of it. I would also suggest that, now you have 7-Zip installed, you use it for all of your file archival needs (except where Rar is concerned). It is the business.
I tend to put my extracted InstantRails folder in the root of C:\, making it easy to find from the command prompt (we’ll need to use the command prompt a little bit).
The first thing to do is open up the InstantRails folder in Explorer and double click InstantRails.exe. It’ll ask you if you want to update your references to C:\InstantRails. You should answer Yes.
A small pink window will appear. If you have IIS installed, you’ll be warned that port 80 is already in use and you will need acknowledge the problem. Instant Rails is a command center for running Apache and MySQL on an ad-hoc basis (i.e. if you log out of Windows or close the console, Apache and MySQL will stop). We don’t really care about Apache (not for learning Rails) since we’ll be using a Ruby module to serve our pages, so you can safely ignore the fact that Apache might not be running. All we care about is MySql (and, of course, Rails).
To see Rails in action we must open a command prompt. I don’t wish to insult your intelligence, but maybe someone doesn’t know: Start -> Run -> “cmd”
At the command prompt:
cd \InstantRails
use_ruby.cmd
That sets up our environment so that ruby and the various rails commands are now in our path. Try:
rails -v
and you should see Rails 1.2.3 (or something like that). If so, all is well, and you can create your application:
cd \InstantRails\rails_apps rails MyAppMySQL
If the Instant Rails control centre is running then MySQL is ready and waiting. You will probably have noticed that when you minimize Instant Rails that it disappears from your task bar and becomes an icon in your notification area next to the clock. By default, you log in using these details:
server: localhost username: root password:There is no password, but for security reasons only connections from the local machine are accepted. To create a new database, I suggest that you use MySQL Query Browser. You should enter the above details, but the first time you do it you will get a warning message (I can’t remember what it says off the top of my head - I’ll try and remember to look it up though). You need to tick the box to say “Don’t warn me again” and then log in for a second time.
The schemata panel should be visible, docked on the right-hand side of the window. Right click any area inside this space and choose ‘New Schema’. This is probably the easiest way to create databases. The database name, along with the login details above are what you will use in database.yml.
You shouldn’t create your tables in the MySQL Query Browser, even though you can. I suggest you use migrations instead.
RadRails
RadRails requires the Java Runtime be installed. For maximum performance, you should install the Sun JRE 1.6.
RadRails needs extracting, and a logical place to keep the extraced RadRails folder is in C:\InstantRails. When you run RadRails.exe for the first time, you will be prompted to select a folder for your WorkSpaces. Enter C:\InstantRails\Rails_Apps.
You can now explore the IDE. The rails options will make a lot more sense once you’ve read Agile Web Development with Rails!
Closing Thoughts
It’s not quite as easy to get started as Visual Studio, but once you’re used to it, the Ruby on Rails environment is much better because of the flexibility it affords. Using the console to run scripts, servers and so on gives you massive advantages when you come to automate certain tasks later down the line.
Ruby on Rails is a truly great language. It deserves to be given a chance, and I hope that this article has gone some way to invalidating one more excuse for not at least taking a look.

Netbeans 6 is also a very good IDE for Rails development, and it appears to be moving much quicker than the RadRails tool.
Just my two peneth…