Fixing problems caused by using an old version of RubyGems (1.7.2)

Posts

I recently had to install an old version of RubyGems (v1.7.2 to work around an incompatibility with a Rails 2.3.x app I’m working with. This caused Capistrano to freak the older RubyGems version out with this error:

Invalid gemspec in [/Users/myusername/.rvm/gems/ree-1.8.7-2012.01@mygemset/specifications/capistrano-2.11.2.gemspec]: invalid date format in specification: "2012-02-22 00:00:00.000000000Z"

This broke RubyGems so bad that every gem (such as the Rails gem) stopped working because RubyGems wouldn’t load. Switching to an earlier Capistrano didn’t help, so I ended up just changing the date manually in the Gemspec (the file listed by the error). I did that by changing this line:

s.date = %q{2012-02-22 00:00:00.000000000Z}

to:

s.date = %q{2012-02-22}

After that, everything started working again. Messing with the Gemspec like that probably isn’t ideal for various reasons, but it got my environment going again.

Update: Yeah, turns out it’s a pain in the backside running with a old version of RubyGems. This problem isn’t just Capistrano, all my gems started freaking out. Solution to that was to nuke all my gems (thankfully I use RVM so it was just a case of rvm gemset gemsetname delete), upgrade rubygems with gem update --system and start over again.

Leave a Reply

Your email address will not be published. Required fields are marked *