I was getting this error on some pre-2.0 rails sites when trying to run rake after upgrading it to 0.8.1:
rake aborted!
undefined method `last' for {}:Hash
Luckily gem lets you have multiple versions installed and I was able to add this to my .profile:
alias old_rake="rake _0.7.3_"
Now I just run old_rake whenever I want to use rake on those sites and I don't get the error. I know this is a sucky, hackish solution, but I'm too lazy to find the real problem. Especially when I only work on a couple sites not on rails 2 yet.