The new year has just begun and I'm spending the last couple of days of my vacation. The last three weeks were my first real vacation since march. For the last 9 months I was busy building a website for an international corporation with ruby on rails. I thought I should share some of the experiences we (the entire development team) made. For anonymity purposes I will call this project miracleCMS2.0. This post is about rails and windows, or deploying rails on windows. When the project started it wasn't really clear what technology would be involved. When I joined the team, Zope was chosen to build the new customers website and content management system. The only problem was that there was nobody in this company with deep knowledge of the Zope framework. To make it worse, there wasn't any real web developer either. My knowledge of Zope was so limited that I wouldn't be any help as well. Needless to say that the timeframe for this project was so narrow that chances for getting it done in time were close to zero with any framework or cms. Based on very good experiences from recent projects I made a pitch for rails as base technology and after some internal presentations and meetings it was agreed that we would use it. There was only one problem. The customer had a homogeneous Microsoft environment, which meant Windows 2003 Server, MS SQL Server and IIS. We all know that rails isn't famous for working smooth on windows, many of us tried, many of us gave up. We tried to convince the customer to give us a linux/bsd virtual machine in their Microsoft world but they refused. After a couple of days it was clear that we would have to deploy on windows no matter what. Windows alone scared us but MS SQL Server and IIS really made us reconsider our rails choice although it wasn't based on first hand experience. Anyway, it was too late to go back. We started internally on linux only, of course with mysql as db backend. We hired another guy who was only there to figure out how to run our rails app on windows and after a couple of weeks we had a capistrano task to deploy from our linux / mysql machines to the windows / ms sql machines. We chose to try it with IIS and Pen as a load balancer for a couple of mongrels. We also installed the ISAPI rewrite module so we could rewrite requests to the Pen load balancer and to the mongrels. For the first hours it seemed to run. That alone was a success. We managed to make a capistrano task that would deploy the software, the data and interact with the windows machines, restarting services and everything. At least that was what our first euphoria was suggesting. After another couple of hours the whole setup broke together like a card house as the Pen load balancer would stop working once in a while. The IIS itself stopped working too because the ISAPI rewrite module didn't rewrite properly or the whole machine was just so busy with doing nothing it couldn't do anything else. Now the customer insisted on his Microsoft software as he payed so much money for license fees and all and so we invested hours, days and maybe even months to make it work but if we got some part working, another one would break apart. The whole setup just felt unstable. One day I had enough and installed Apache2.2 on one of the windows machines as a proof of concept. Apache comes with mod_proxy and mod_rewrite which just eliminated two (or three if you count IIS) of the fragile software parts right away. To make this short - it worked right away and without any issues. Over the next days I told my colleagues that I installed apache and how much smoother everything was running and as much as they liked the good news, they new how bad the news for the customer would be. Fortunately, the customer was also pleased with the new stability and found acceptance for the apache setup over the next couple of months (yes - it was a process). The MS SQL was also an issue of course as you wouldn't get real utf-8 encoding and other quirks but these problems were mostly manageable but they costed a lot of time and money. Actually that was the one big lesson of deploying on windows. It costs a lot of time and money to make it work. It slows your development down, massively. Thats why I'd like to postulate the following advices: If you want to use rails, do whatever you can to convince the customer not to use windows. If you fail at convincing your customer not to use windows, try at least to get a virtual machine with linux to run the web server on If that fails too, try to convince him not to use IIS but Apache. Try also to use PostgreSQL or MySQL instead of MS SQL As I said, if you fail at one of these steps, you will have so much pain, so much waste of time, money and resources for making _everything_ work in a smooth and performing way. Besides that you'll get deeply frustrated! I mean there are solutions, blog posts and stuff but you have to patch them together and most of them are for specific software versions, some google results point to non existent pages, promising forum threads have nothing but more questions, the plugins you could use were abandoned a long time ago and make everything unstable. Oh and I forgot to mention the windows clean install after you messed up the first time. I don't know if I have to say more but maybe previous experiences with Cygwin ring a bell. You'll just end up with a pile of software and configuration that wasn't meant to work together. Get as far away from it as possible! Seriously! Not fun! Having a ruby installed in the Windows and Cygwin world … *shiver* Our project currently runs on Windows2003 Server with Apache 2.2 with mod_rewrite, mod_cache and mod_proxy and does so pretty fast and stable. The db server is a MS SQL machine. Until something fundamentally changes, I hereby swear not to deploy a rails web application on windows again.