Ruby on Rails – How to Serve Applications on Windows Server 2008

apache-2.2iis-7ruby-on-railswindows-server-2008

I have spent the last several hours attempting to get Ruby on Rails running on a Windows server with no luck.

At first I tried configuring a test application through IIS7's FastCGI support, but the documentation for this is not very good. I've been following this blog entry, and this one, and this one, and this one but everything seems to be missing major steps, or are out of date. And every article keeps linking back to this Howto from rubyonrails.org that doesn't exist.

The sense that I'm getting is that even if I manage to make this work, IIS' FastCGI isn't good enough to use in a production environment anyway.

So it looks like my best bet is to setup a reverse proxy in IIS that points to Apache & Mongrel/Passenger using ARR and UrlRewrite. Is there anybody else out there stuck deploying a Rails application on a Windows stack? Am I on the right track? Can you give me a better idea of how to configure this?

I believe Plesk already installed an instance of Apache/Tomcat running on this server using a different port, so adding another virtual host shouldn't be difficult; the hardest part seems to be setting up the reverse proxy through IIS.


Addendum

Since posting this, I have gone on to build a virtual server running Linux and serving our Rails products with Apache, Passenger and Ruby Enterprise Edition.

Linux is so easy, cheap and reliable an option that trying to jam the square peg of Rails into the round hole of Windows/IIS is a fool's errand.

The only possible exception to this is if your Windows env. supports Java, and you can use JRuby. By all accounts it is one of the better Ruby implementations. Otherwise, give up and save your sanity.

Best Answer

Save your sanity!!! RoR for Windows 2008 isn't there yet. Seems like things have barely caught up with Windows 2003. Keep a look out for IronRuby for IIS from Microsoft. It's just not cooked yet though.

Until then, find a TEMPORARY solution. Use mongrel and install the prerelease version of mongrel_service to get it working with W2K8:

http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/1adf2a73c75c2884/38267c06198e282e?show_docid=38267c06198e282e

I did this to get Redmine working and seems like the most solid solution for now. I was able to recover some of my sanity back. I have tried all the articles you found and more. Even tried cooking IronRuby myself and got it to work with RoR basics, but failed with Redmine. Mongrel worked and is extremely fast, not sure if it is scalable though.