I am getting the following error when I try to use gems in windows, and I also referred to this stackoverflow post and updated rubygems and rails. But nothing could solve t
None of these solutions worked for me. To fix it, I removed all the content of the mentioned directory (some/path/to/specification/) then I installed the gems I need (actually, Bundler then bundle install).
As Michael said in the comment:
gem pristine --all
In my case, the referenced gem versions weren't even installed. I had those gems, but not the versions who's gemspecs were causing the error. So, I just deleted each of the /path/to/specifications/offending-X.Y.ZZ.gemspec files.
The ultimate solution is this:
Search "spec" files in your Ruby directory: *C:\Ruby187\lib\ruby\gems\1.8\specifications*
If a gemspec file contains something like this: s.date = %q{2011-10-13 00:00:00.000000000Z} Then delete the 00:00:00.000000000Z part: s.date = %q{2011-10-13}
After saving those gemspec files, the problem is solved.
cd vendor/bundle/ruby/1.9.x/specifications
sed -i 's/ 00\:00\:00.000000000Z//g' *
Invalid gemspec in [/var/lib/gems/1.8/specifications/chronic-0.6.4.gemspec]: invalid date format in specification: "2011-09-09 00:00:00.000000000Z"
The simple fix to such kind of problem is to navigate to the file.. for eg.
Step 1. cd /var/lib/gems/1.8/specifications
step 2. open the file(chronic-0.6.4.gemspec) in editor of ur choice... (gedit chronic-0.6.4.gemspec)
step 3. change the s.date = %q{2011-10-13 00:00:00.000000000Z} to s.date = %q{2011-10-13}
Cheers :)