Tuesday, September 13, 2011

Invalid date format in gemspec


Recently I faced a issue while executing bundle update on a ruby project. The gems that got updated were cucumber 1.0.4, gherkinn 2.4.18, webrobots etc. After this update I was getting "invalid date format in gemspec" with the path of the gem in the error description on firing many of the commands like running any rake task. After looking into the *.gemspec file those were corrupted and comparing them with the other ones those were proper, I found that date format was the issue. The wrong date values were having the time value like "00:00:00.00000Z" which was not required only the date part was required. Fixing the date values solved the problems related to date format, but after that I was getting this error "Illformed requirement ["# 0.8.4"]" for 1 of the gemspec file. I finally had no clew what was going on, I simply ran few commands that solved the problem:



  • gem update --system.

  • gem update bundler.

  • bundle update on the ruby project.


Hope this helps.

1 comment:

  1. Did not work on Mac. But your offline suggestion of removing the gemspec file to a different location and then running "bundle update" worked like a charm.

    Thanks!

    ReplyDelete