Tuesday, April 10, 2012

"Invalid date format..." Rails in Ubuntu 11.10

I'm following this tutorial for Ruby on Rails and discovered an annoying error when installing Ruby on Rails in Ubuntu 11.10.

rails -v

Invalid gemspec in [/var/lib/gems/1.8/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/mime-types-1.18.gemspec]: invalid date format in specification: "2012-03-21 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/mail-2.4.4.gemspec]: invalid date format in specification: "2012-03-14 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/mime-types-1.18.gemspec]: invalid date format in specification: "2012-03-21 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/mail-2.4.4.gemspec]: invalid date format in specification: "2012-03-14 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/mime-types-1.18.gemspec]: invalid date format in specification: "2012-03-21 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/mail-2.4.4.gemspec]: invalid date format in specification: "2012-03-14 00:00:00.000000000Z"


I stumbled across this blog post and it solved my problem. Apparently, some gems may have some date formats that don't validate. Running the following command will remove those invalid date formats:

sudo sed -i 's/ 00:00:00.000000000Z//' /var/lib/gems/1.8/specifications/*


All credit goes to Nikolai Penkov!

Resources:
Piece of Cake + Coffee: http://npenkov.com/2011/11/08/get-ruby-on-rails-working-on-ubuntu-11-10/

No comments:

Post a Comment