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.
While using Prism for Basecamp I ran into an annoying little problem that all the icons from Prism are the default ‘world’ type of icon. I hated this plus it was hard to distinguish the different applications on my desktop. So I found a way to remedy this situation.
First I went out and tried to find some high quality icons for Basecamp. Low and behold… 37 signals themselves have provided some decent rez icons to be used for just this occasion. There you can find icons for Basecamp, Backpack, Campfire and Highrise.
Fantastic! Now all we need to do is open your favorite photo editor and size these PNG files down a bit. I resized to a width of 128px and let the height auto populate via keeping the proportions. Save that back out as a PNG file and we’re off to the next step.
Now we are going to take that PNG file and upload into a mega useful little web app from Punk Labs called ConvertIcon.
It’s main function is to turn any PNG file into an ICO file and vice versa. Once you are there browse for your file using the “Upload a PNG or ICO” option. Almost immediately you will be shown a download link to grab your spankin’ brand newly converted .ico file.
Put that file somewhere on your machine. I created a folder under my Windows directory called Icons (figured it was the most logical place). Now go to your bland old application icon and right-click and then select properties. Click ‘Change Icon’ and then ‘Browse’ for your newly created .ico file. Click ‘OK’ once you’ve found it and then ‘Apply’. That’s it! You are the happy recipient of a brand new awesome application icon.
These instructions will work with any app (Prism or not) and with any image as long as you like the pic… go ahead and try it.
Download Prism for Windows, Mac and Linux
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’.
Hot on the heels of the 37 signals article about Launchbar… I have created a quick tutorial on how to get the same functionality out of the fantastic Windows application launcher, Launchy.
First you will need to download Launchy from Sourceforge, if you don’t already use it that is, (current version is 2.0).
Once you are up and running, invoke Launchy by using the keyboard command Alt-Space (unless you have changed the defaults).
Right click on launchy and select Options. An options window will pop up and then go to the Plugins tab.
1. Click on the ‘+’ to add another entry.
2. Add a name to pull the search up as. I used ‘Backpack’, you could use ‘BP’… whatever you want.
3. Click over to the URL column and add your Backpack URL. (http://yourbackpackname.backpackit.com/)
4. In the Query column you will want to add ‘pages/search?term=%s‘. Don’t forget the ‘%s‘ that is what Launchy uses to insert your query string.
5. Hit OK.
That’s it. Now you can invoke Launchy once again and begin typing your search name. For me I begin typing Backpack. It will show up after a few letters and you can then hit tab to complete. You’ll now see a little arrow after Backpack and can type any search you’d like.
It will pop up your browser and open Backpack’s search with your query. You may have to log into Backpack first. I experienced this, but after that it worked flawlessly.
You can perform these same instructions to get search functionality into Launchy for just about any service that has a search capability. Have fun and I hope this makes life a little easier