Invalid date format specification in gemspec

后端 未结 18 2035
野性不改
野性不改 2020-12-04 09:47

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

相关标签:
18条回答
  • 2020-12-04 09:55

    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).

    0 讨论(0)
  • 2020-12-04 09:58

    As Michael said in the comment:

    gem pristine --all
    
    0 讨论(0)
  • 2020-12-04 09:58

    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.

    0 讨论(0)
  • 2020-12-04 10:00

    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.

    0 讨论(0)
  • 2020-12-04 10:01
    cd vendor/bundle/ruby/1.9.x/specifications
    sed -i 's/ 00\:00\:00.000000000Z//g' *
    
    0 讨论(0)
  • 2020-12-04 10:02

    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 :)

    0 讨论(0)
提交回复
热议问题