Windows is not the most friendly of programming environments. In fact, some would go so far as to say that it is outright hostile. An environment like Mac OS X or Linux is so much better for doing things like this, but sometimes you just have to use Windows. Either you don't want to learn a new OS, you need to use this OS on your work computer or you actually prefer Windows. At any rate, installing Rails on Windows is a long and laborious process, or at least it would be if someone didn't do all the hard work for you (which they did, keep reading!).
Installing Ruby on Windows without the Ruby Installer is just plain evil. I wouldn't recommend it to you unless you are a masochist. Similarly, installing Ruby, Rails, the gems Rails needs, SQLite3, Git, etc on Windows and getting all of it to play together will probably take you longer than it will to actually develop your application. But someone has done the hard work for you, thankfully. The Rails Installer program should do everything for you in just a few clicks. Using this installer, it actually makes Windows the easiest platform to get up and running on.
To install Rails using the Rails Installer, simply go to the Rails Installer website, download the installer and run it. That's pretty much it. There's even a video on their website that shows the whole process and discusses some of the things you get from the installer. This video goes even further by showing you how to upload your code to Github and even how to deploy on the EngineYard cloud (for which there is a free trial). You don't need to jump into all of that right now if you don't want to though, let's just get Ruby and Rails installed.
First, you'll probably want to uninstall any other Ruby installations you have. If you really need to keep them, you can try installing them side by side, but depending on where the environment variables are inserted for the Ruby paths, things can really go astray very quickly. So hop on over to the Control Panel, search for "Add or Remove Software" and uninstall Ruby and the DevKit, if you had that installed.
Next, go ahead and run the Rails Installer and let it do its thing. There are a few checkboxes along the way, but you probably don't want to touch them. Change the path if you wish, I had a faster and larger D: drive I use for things like this. Once it's finished, it'll bring up a git configuration window that asks for your name and email. This is important if you plan on using Git (which you really should be) and really important if you're using Github or pushing to services like EngineYard. Don't worry, this info isn't automatically sent anywhere, it's just used when pushing to git remotes and when doing git commits.
The installer will also direct OpenSSH to generate some public and private keys for this machine. It even go as far as copying the public key to the clipboard automatically, so you can put them into Github, Heroku, EngineYard, etc easily. Really, this installer goes out of its way to make things easy for you.
And that's about it, you're ready to go. That was easy, wasn't it? It wasn't always this easy. In fact, it used to be a nightmare. It's because of the awesome work by the guys at EngineYard (Wayne E. Seguin included among them, the guy who makes the equally awesome RVM) that you can develop on Windows so easily. So if you need hosting and want to support them, consider EngineYard!
What You Get
Besides Ruby and Ruby on Rails, what do you get from this installer?
- The DevKit - Normally, you'd be using the system's GCC to compile Ruby gems with native extensions. However, since Windows doesn't come with GCC and installing it is hit or miss, there's a Ruby DevKit that usually goes along with the Ruby installer. This is installed automatically for you.
- Git - Not hard to install on Windows, but the Rails Installer has taken care of it for you.
- Ruby, Rails and Bundler - Every Rails developer is going to need these things, you won't have to run a single gem command to get started!
- SQLite3 - Not a powerful database, but a simple database preferred by Rails developers worldwide. It's in there and ready to use.
- TinyTDS and an SQL Server adaptor - If you're running on Windows, maybe you'll want to interface with a Microsoft SQL Server? They've got you covered, you have the tools you'll need to do this out of the box. Not very useful for starting a new application, but many Rails applications replace old database frontends, and they'll need access to the old database to do that.
- Hair and Sleep - You won't pull out a single hair installing Rails on Windows with this tool, and you'll get to bed a few hours early too. It's not on their feature list, but it should be!
Their website hints at Linux and OS X releases of this tool as well. If they keep this up, it'll be the way everyone gets into Rails (except already season Rubyists, who probably have all this stuff anyway). But at the time of this writing, they're not yet released. Bummer, those of you on Linux and OS X actually have it hard this time!