The big project we’re working on needs to be demo’d to the board next week. It won’t be finished but with only 3 weeks to go before we beta it’s important we show good progress. Understandably then the entire team is under the gun and working really hard to get the demo ready.
I’ve got a ton of code of my own to do for this and am working nights, mornings (from about 4am) and weekends to get my own work done in and around my duties as the team lead. So naturally, when I started to make some really good progress yesterday, that was the point in time that the 3 amigos (Ruby, Rails and RSpec) decided to go a little obscure on me.
I needed to rename a model, controller and views. Subversion decided to be a pain in the ass and throw a fit at so many svn mv commands being issued which threw me for a loop for about an hour trying to fix everything subversion wise. When I did get it fixed, I ran ‘rake spec’ to test the project and found a ton of failures. Larry had come over by this point to complain loudly that I’d broken the source. I made some changes, and checked it back in in the hopes of quelling some of the errors by fixing the obvious. I still had a lot of failures though.
As I started to look around the errors though, none of them made any sense. We’re not just talking about the usual programmer beating their head on an obvious wall kinda weirdness, but real freaky ships vanishing in the Bermuda Triangle weirdness.
Dray took a look, grabbed the source and ran ‘rake spec’ himself. No errors. Larry did the same. No errors. I did it again - a ton of errors, but nothing I spent about 2 hours working on this then gave up and came home only to carry on again last night.
No matter where I looked, and what I tried, nothing would make the errors go away. I put the project on another Mac at home and got zero errors, but my work macbook kept showing me a flood of them.
I got up this morning at about 3:30am and started again. I decided to go back to basics. I compared the Ruby gems on my Macbook with those on my Mac Pro and stripped out anything different. I uninstalled gems with different versions and then reinstalled them with the same versions as on my Mac Pro. Still errors, and still the Mac Pro told me nothing was wrong.
I built my development environment from source, so in desperation I re-installed Ruby. Still I had errors. I zipped up the Ruby install and the gem library on my Mac Pro and replaced the one on the Macbook with it. Yup, the errors were still there. Throughout this all I should point out that running an individual test suite on both machines never gave me any errors at all.
Completely desperate, after about 8 hours on this, I started to fire the command Rake Spec was issuing but removing tests one by one to identify just what was going on. Eventually I found 4 tests that were all calling Ruby’s Lambda method. It just looked weird to me so I commented out those lines in each of the 4 tests. I ran rake spec and everything passed.
Gingerly I started to put the lambda calls back in, one by one, until eventually they were all back the way they should be. I have no errors now.
But, I didn’t do anything! If I grab the source tree from subversion onto my MacBOok now, something I’ve done countless times in the past day to see if the problem would magically go away, the problem seems to have magically gone away. I have no idea why.
Sometimes Ruby and Rails are just obscure that I want to permanently can them and switch to Python and Django forever.