Yes, it can be done! Contrary to popular belief… Windows can be a great Rails development platform. I know that those Mac guys have you all convinced that it’s too hard and painful to do and you should just go be a switcher. Well today I am going to show you, with a little work, you can be up and running with ease….similar to a Mac.
To begin, I wanted to say that the basis for this article orginally came from a post over at Garbage Burrito on how to get a Mac-esque development environment using windows. After being asked a few times at my local Ruby group how I develop on a Windows machine… I have decided to go a little more in depth and show you exactly what I’ve come up with. So here we go!
Most of you may already know that Sqlite3 is the default database used by Rails now in 2.02. This can be easily changed using the ‘-d’ parameter when using your ‘rails’ command. The reason I mention this is because I’ve been using Sqlite3 for a bit and have had a bit of difficulty when it comes to using add_column in my migrations. For that reason I am going to suggest installing MySQL. If you know what you’re doing and don’t want MySQL, go ahead and skip this step.
Step 1 | With that being said… Go install MySQL. You can easily find it at their site. I suggest not grabbing the ‘Essentials’ version just to make sure that you have everything you need if the time comes. Make sure you go through the installer and at the end you’ll want to use the ‘Server Instance Config Wizard’ to setup the server.
Step 2 | Go install e-Text Editor! I have used a bunch of text editors to try and get that TextMate feel but this is so far the closest Windows alternative. If you like it, please buy it. The creator updates very frequently and I’m sure he would love your support.
Step 3 | Since e-Text Editor is a TextMate clone… it uses a lot of UNIX commands. So we’ll now need to now install Cygwin. This is a emulated UNIX shell that can run under Windows. This also helps since a lot of the tutorials for Rails were created under Mac/Linux… you can easily follow along. Pretty much click through the installer. There are only a couple places to make sure settings are correct. When you hit the ‘Choose Installation Directory’ screen, you will want to make sure that ‘Install For’ is set to ‘Just Me’ and the ‘Default Text File Type’ is set to ‘Unix / binary (RECOMMENDED)’. These are probably the default settings but I wanted to make sure that you get this correct. Go ahead and continue clicking through the installation screens until you get to the ‘Select Packages’ screen. Think of these as a list of ‘addons’ for Cygwin. You will need a bunch of them so I will list all that I use. To make it easier, click on the ‘View’ button until it changes to ‘Full’. Now we can see all packages available. These are the packages I have installed (many are selected by default but these are extras you will need):
Go ahead and finish going through the installer. It may install for a while, that is normal.
Step 4 | Do yourself a favor and install Console. This very useful program lets you have tabbed command prompt windows open. Once that is installed you will want to go into settings and add a tab for Cygwin. Name it whatever you want but you’ll want to enter this command ( c:\cygwin\bin\bash –login -i )into the shell field. Enough said.
Step 5 | Install Ruby Gems. Download and unzip to your system. I put mine in the root directory, doesn’t really matter where it goes. Once you have that done… use Cygwin to navigate the the Ruby Gems folder. Then install Ruby Gems by invoking setup.rb.
Step 6 | Install Rails. Now what you’ve all been waiting for… Ruby on Rails. Rails will come to you as a ‘Gem’. It’s really just a kind of package management, which is really great for keeping things up to date. You can install any gem using the ‘gem’ command and a sequence of parameters.
gem install rails --include-dependencies
When going through this process, the package management will ask you to install other gems as well. These are OK as Rails has dependencies and we want them included. These should be:
Step 7 | Install other needed Gems. This may be different for all of you, but since we are using MySQL… we should install the gem that binds rails to it. I will also list some others that I have been using. Please let me know what you start out with in the comment section.
Step 8 | Try it out! Hoping that I didn’t miss anything here… this should work! From now on you’ll be using Cygwin as your command line editor. When you start Cygwin, you should be placed in your ‘home’ directory. I usually make a directory called ‘websites’ or something similar. I recommend this so you don’t have your projects scattered all over your home directory.
Now you will want to cd into your ‘websites’ directory so that we can make a new Rails project. Go ahead and make the obligatory test blog using this command.
Again, now that Sqlite3 is the default database for Rails… you’ll need to add the ‘-d’ parameter with what database you’d like to use. As previously discussed, we will be using MySQL.
If all works correctly, you should see Rails creating your directory structure and all is well! If not, go ahead and leave a comment on how much I suck at writing tutorials. :-)
Hope this helps the Rails/Windows community and again please let me know if there is anything I can add to this article.
Thanks to Ben Kittrell of Garage Burrito for laying the ground work with his original article.

I stumbled across this (what I believe to be) ingenious method of spam protection and I would like to share it with all of you. At the moment it’s being called ‘Negative CAPTCHA‘. It’s like CAPTCHA but in reverse. What I mean by that is instead of having a user fill out a form field with gibberish… you have them bypass the form all together. The reason they will not fill it in is because IT WON’T BE THERE. The method looks for an invisible form field to be posted with no information. The form field will be hidden by CSS so the human user will never see it. Bots on the other hand don’t take into account for site layout or styling. The form field will be there when the bot comes along and blankets your form with miscellaneous data. That hidden form will then be populated in the post and will easily identify your ‘user’ as being a bot.
Now I know that you would need to take into account for people using screen readers or possibly someone that turns off styles, but for the most part… this method should work. I will be implementing this in my next project and hope to post an update with what I’ve found.
Ned Batchelder also has some useful information on stopping spam bots with a similar method.
[amazonify]0596529864::text::::Learning Ruby[/amazonify]
Learning Ruby is exactly what the title says. This book offers a great ‘introduction’ to Ruby as a fun, powerful language. Now I would say that as a Ruby user, I’m not quite advanced but not really a beginner. I would have to say that this book is definitely catered to someone very new to the Ruby world. The books author, Michael Fitzgerald, uses a very easy to read style of writing that, to me, made this read far easier than a normal technical book. He uses this same easy to follow/read style in Ruby Pocket Reference and Learning XSLT as well.
Inside you will find small easy to digest chapters that give a quick explanation on what you’ll need to know such as: blocks, arrays, loops, functions. The basic stuff that will lay the groundwork. I believe that the books description may be the most accurate depiction of this book. It does not lie about it’s intent. Going in you will know that this is a book that will show you how to get started and really primes you for other more in-depth books (The Ruby Way).
Personally I didn’t really understand why at the end of the book you get an extremely brief introduction to Rails. The only reason I think is because on the cover you get a tag line of ‘The Language That Powers Rails.’ So they kind of needed to put something in there. That is really the only grief I found with the book. While doing some searching for other reviews of this book… I found that many people didn’t like it, but I truly believe that those people may have already been using Ruby for a bit. Then of course this book would seem like a waste. It is what it is and that’s a beginner’s introduction.
Rated: *** out of 5
Yesterday I gave a small presentation on migrations in Rails 2.0 for the Chicago Ruby group. It went fairly well I think. Not being the most in depth presentation… I hope that someone got something out of it. I think that the new Rake tasks were a little more interesting for the group to learn about than the actual migrations. Here is the slideshow ( I really suck at Powerpoint) and I’m sure it will also be available at the Chicago Ruby downloads page.
Update: You can now view the slideshow here, courtesy of Scribd’s own ‘iPaper’.
This morning I came across this article in via Google Reader. It’s about a guy who built and deployed an app in 24 hours. Wow, this guy is really kicking out the jams! Thankfully this is 24 total hours and not a 24 hour period… cause that’s just crazy. He was able to accomplish this using Ruby on Rails and subversion (like all good girls/boys people should).
Anywho, the article is great because he documented the whole thing with how long it took each task as well as, and more importantly, linked to everywhere that was a great help to him. Even though most of the articles I have already seen… it was nice to see them compiled into something complete. I enjoyed it and I hope you do as well.