2

For every gem execution I am receiving the following error:

Invalid gemspec in [...rvm/gems/ruby-1.9.2-p136/specifications/webrobots-0.0.10.gemspec]: invalid date format in specification: "2011-07-01 00:00:00.000000000Z"

I am not the webrobots maintainer and I can't uninstall that gem.

There is any safe action to fix this problem on a production server?

lbz
  • 9,560
  • 2
  • 30
  • 35

3 Answers3

4

These days with Github and Bundler you don't have to be a maintainer in order to fix issues in the gems you're using. Just fork the project on Github, fix whatever issue is there, and them simply point Bundler at your fork. If it is a handy extension to the gem rather than just a hack for yourself you might also consider making a pull request to the original maintainer to roll your changes into the official gem.

Having said all of that, the issue that might cause this problem doesn't seem to be present in the gemspec of the 0.0.10 version of webrobots. This issue can occur when the date in the gemspec is in the format that you have in your error e.g.:

"2011-07-01 00:00:00.000000000Z"

Looking at a snippet of gemspec though we have:

s.authors = [%q{Akinori MUSHA}]
s.date = %q{2011-07-01}
s.description = %q{This library helps write robots.txt compliant web robots in Ruby.

So that seems to be correct. Another issue that has been known to cause this problem is a YAML parser issue, to fix you need to force the use of a particular YAML parser (psych). You need to define the following somewhere:

require 'yaml'
YAML::ENGINE.yamler = 'syck'

Lastly you might want to clean your local installation and then do a redeploy which may sort you out. Once again if you're using Bundler something like this:

gem update --system
rvm gemset empty mygemset
gem install bundler
gem install
Community
  • 1
  • 1
skorks
  • 4,376
  • 18
  • 31
2

Here is the way I fix the "invalid date format in specification" error:

1.) Go to the specifications folder located at:

/usr/local/lib/ruby/gems/1.8/specifications/

2.) Find the spec that is causing the problem.

3.) Change "s.date = %q{2011-05-21 00:00:00.000000000Z}" to "s.date = %q{2011-05-21}"

That's a WIN for me! Good Luck

ben hall
  • 1,619
  • 1
  • 11
  • 5
0

You may be using old version of gem. See you current version gem -v. Upgrade you gem to latest

gem update --system

And install you gem file again with new gem. gem install <gem-name> or bundle install

Sayuj
  • 7,464
  • 13
  • 59
  • 76