Added workarounds to support current Rails/Rubygems

After making these changes I was able to run rake tasks on Ubuntu Oneiric / Mint 12.