A couple of weekends ago I was about to begin a large amount of re-factoring of our Ruby on Rails app (more on that to follow) to move it from a functional wireframe of the app to the final polished first version that users can use without cursing us. However I’d knocked together the wireframe version fairly quickly and had not taken time out to put down some decent test coverage, yes I know, and doing the amount of re-factoring I was planning without having any tests to verify that I haven’t broken anything isn’t a good idea.
So I undertook to get our test coverage up to scratch, I got ZenTest to ensure that the tests get run for every saved modification, which is a great help during development. But this exposed me to something which I had already started to notice but which hadn’t become a real issue yet, Ruby on Windows is slower than a 1-legged dog down the dog track. ZenTest was taking 20 seconds or more to even notice a file had changed and then took even longer to begin the test. Combined with Ruby using 100% CPU most of the time this really dented my productivity and I had to do something. Luckily all that spare time I had while I was waiting for the tests to run every time I pressed save meant I could look into resolving the problem.
After investigating the problem further it seemed like there was some issue with the startup phase of Ruby, as it took ages to get things like Webrick, mongrel, IRB, Rake tasks etc. started but once they were running everything was fine and dandy.
I came across a few solutions but I opted for this solution using andLinux – which is a install of Ubuntu Linux for running within Windows, think VM but without the hassle of setting up a VM, or think Cygwin but more powerful (you can do apt-get to get any Ubuntu package quickly etc.). That tutorial helped me to setup andLinux and my Ruby & Rails environment in under an hour.
Suddenly it was all blazingly fast and I was happy developing again.
I then looked to my IDE, I had been using RadRails for eclipse but no longer needed many of it’s features I was using and I had noticed that while editing Rails stuff it would start off Ruby (apparently randomly – well I couldn’t figure out the connection between what I was doing and when Ruby would start) which as I say uses 100% of my CPU in Windows.
I wanted something lighter, I wanted something cleaner and I wanted all the cool snippets that TextMate gives you when developing Ruby/Rails (or pretty much anything) on OS X. Luckily I found exactly what I (and lots of other people) want in TextMate for Windows - in the guise of “e”, which is a fantastic name for launching it via Launchy.
A quick install of e and a play around with the themes to make it easier on the eye and I was in editor heaven (or as close as I’ve got so far on Windows).
Finally I then found that I had lots of PuTTY windows open to my andLinux install (one for mongrel, one for Zentest, one for log tailing & another for bash), finding which window was which became annoying – within about 2 minutes. So looking for a tabbed UI for PuTTY I came across two, PuTTY Tabs and PuTTY Connection Manager. I tried them both out but it instantly became clear that PuTTY Connection Manager was the better of the two for my needs (the fact that it wraps all your PuTTY windows into one with tabs was the main winner). Now I have (at least) four tabs open in PuTTY Connection Manager and rename them all to suit (e.g. [mongrel],[zentest] etc.) making it much, much easier for me to manage.
So the short-list of things that increased my Ruby on Rails productivity in Windows is as follows:
- A Linux install :) to run Ruby on
- ZenTest autotest, I couldn’t live without it anymore
- PuTTY Connection Manager
- Launchy which I had before but really does increase productivity.
- TopDesk which I’ve also had for quite a while, but still very useful.
I guess the moral of this story is if you want to develop with Ruby on Windows use Linux. I am planning on a move to Ubuntu at some point, but really don’t have the time to start from scratch with my system right now.