Thursday, April 13, 2006

Lessons Learned: Migrating Ruby on Rails Apps from Linux to Windows

I spent 8 hours last weekend getting Dressr to work on my Windows laptop. This was way too long. Even if none of the issues were major, they just added up to a lot of time, so I wanted to document them here.

I was using InstantRails, which I was cursing, but in retrospect only 1 of my issues was an InstantRails issue.

1) Make sure your SCGI port configuration is a different port than the applications installed with InstallRails by default. (You may not be using them, but that doesn't mean they aren't running.... I wasn't getting any messages in my Rails log because it was all writing to another app's log!)

2) Make sure you install all your mixins. You'd figure this one out pretty quickly on your own.

3) Change all the paths pointing to Ruby. This one actually takes a while to figure out, and the path shows up in a number of places:
public/dispatch.fcgi:#!/usr/bin/ruby18
public/dispatch.rb:#!/usr/bin/ruby18
public/dispatch.cgi:#!/usr/bin/ruby18
script/console:#!/usr/bin/ruby18 -w
script/destroy:#!/usr/bin/ruby18 -w
script/generate:#!/usr/bin/ruby18
script/breakpointer:#!/usr/bin/ruby18 -w
script/server:#!/usr/bin/ruby18
script/runner:#!/usr/bin/ruby18
script/process/spawner:#!/usr/bin/ruby18
script/process/spinner:#!/usr/bin/ruby18
script/process/reaper:#!/usr/bin/ruby18
script/performance/benchmarker:#!/usr/bin/ruby18
script/performance/profiler:#!/usr/bin/ruby18


4) If your files have tabs in them, they need to be removed. (Yes, I know, bad programming style.... I'm now using RadRails, so that isn't a problem anymore.) You can use something along these lines to replace the tabs:
sed -e 's/\t/ /' test > test

After working through these, my app finally worked. Ben and I had a discussion on whether it would have been better to just have checked out the "app" directory, without all the other directories. (Would have had to copy those directories from the sample apps, but I suspect there would have been fewer changes. Hard to tell at this point.)

No comments: