本文介绍了gemspec 中的无效日期格式规范的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在 Windows 中使用 gems 时出现以下错误,我还提到了此 stackoverflow 帖子 并更新了 ruby​​gems 和 rails.但没有什么能解决问题.

以下是完整的错误,

D:> 宝石环境[D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/specifications 中的无效 gemspec/tilt-1.3.3.gemspec]:规范中的无效日期格式:2011-08-25 00:00:00.000000000Z"[D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/specifications 中的无效 gemspec/execjs-1.2.4.gemspec]:规范中的无效日期格式:2011-08-03 00:00:00.000000000Z"[D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/specifications 中的无效 gemspec/temple-0.3.3.gemspec]:规范中的无效日期格式:2011-08-26 00:00:00.000000000Z"[D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/specifications 中的无效 gemspec/guard-0.6.3.gemspec]:规范中的无效日期格式:2011-09-01 00:00:00.000000000Z"[D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/specifications 中的无效 gemspec/guard-livereload-0.3.1.gemspec]:规范中的无效日期格式:2011-09-01 00:00:00.000000000Z"[D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/specifications 中的无效 gemspec/rack-cache-1.0.3.gemspec]:规范中的无效日期格式:2011-08-27 00:00:00.000000000Z"[D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/specifications 中的无效 gemspec/tilt-1.3.3.gemspec]:规范中的无效日期格式:2011-08-25 00:00:00.000000000Z"[D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/specifications 中的无效 gemspec/execjs-1.2.4.gemspec]:规范中的无效日期格式:2011-08-03 00:00:00.000000000Z"[D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/specifications 中的无效 gemspec/temple-0.3.3.gemspec]:规范中的无效日期格式:2011-08-26 00:00:00.000000000Z"[D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/specifications 中的无效 gemspec/guard-0.6.3.gemspec]:规范中的无效日期格式:2011-09-01 00:00:00.000000000Z"[D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/specifications 中的无效 gemspec/guard-livereload-0.3.1.gemspec]:规范中的无效日期格式:2011-09-01 00:00:00.000000000Z"[D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/specifications 中的无效 gemspec/rack-cache-1.0.3.gemspec]:规范中的无效日期格式:2011-08-27 00:00:00.000000000Z"RubyGems 环境:- 红宝石版本:1.7.2- 红宝石版本:1.8.7(2011-06-30 补丁级别 352)[i386-mingw32]- 安装目录:D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8- RUBY 可执行文件:D:/RailsInstaller/Ruby1.8.7/bin/ruby.exe- 可执行目录:D:/RailsInstaller/Ruby1.8.7/bin- 红宝石平台:- 红宝石- x86-mingw32- 宝石路径:-D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8- C:/文档和设置/jeygokul/.gem/ruby/1.8- 宝石配置:- :update_sources => 真- :详细 => 真- :基准 => 假- :回溯 => 假- :bulk_threshold => 1000- 远程资源:- http://rubygems.org/
解决方案

我已通过 将我的 RubyGems 升级到1.8.10

gem 更新 --system

您也可以尝试(按照 ZeissS 的建议)

gem install ruby​​gems-updateupdate_rubygems

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 the problem.

The following is the complete error,

    D:>gem env
Invalid gemspec in [D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/specifications
/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00
.000000000Z"
Invalid gemspec in [D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/specifications
/execjs-1.2.4.gemspec]: invalid date format in specification: "2011-08-03 00:00:
00.000000000Z"
Invalid gemspec in [D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/specifications
/temple-0.3.3.gemspec]: invalid date format in specification: "2011-08-26 00:00:
00.000000000Z"
Invalid gemspec in [D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/specifications
/guard-0.6.3.gemspec]: invalid date format in specification: "2011-09-01 00:00:0
0.000000000Z"
Invalid gemspec in [D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/specifications
/guard-livereload-0.3.1.gemspec]: invalid date format in specification: "2011-09
-01 00:00:00.000000000Z"
Invalid gemspec in [D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/specifications
/rack-cache-1.0.3.gemspec]: invalid date format in specification: "2011-08-27 00
:00:00.000000000Z"
Invalid gemspec in [D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/specifications
/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00
.000000000Z"
Invalid gemspec in [D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/specifications
/execjs-1.2.4.gemspec]: invalid date format in specification: "2011-08-03 00:00:
00.000000000Z"
Invalid gemspec in [D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/specifications
/temple-0.3.3.gemspec]: invalid date format in specification: "2011-08-26 00:00:
00.000000000Z"
Invalid gemspec in [D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/specifications
/guard-0.6.3.gemspec]: invalid date format in specification: "2011-09-01 00:00:0
0.000000000Z"
Invalid gemspec in [D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/specifications
/guard-livereload-0.3.1.gemspec]: invalid date format in specification: "2011-09
-01 00:00:00.000000000Z"
Invalid gemspec in [D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8/specifications
/rack-cache-1.0.3.gemspec]: invalid date format in specification: "2011-08-27 00
:00:00.000000000Z"
RubyGems Environment:
  - RUBYGEMS VERSION: 1.7.2
  - RUBY VERSION: 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32]
  - INSTALLATION DIRECTORY: D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: D:/RailsInstaller/Ruby1.8.7/bin/ruby.exe
  - EXECUTABLE DIRECTORY: D:/RailsInstaller/Ruby1.8.7/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mingw32
  - GEM PATHS:
     - D:/RailsInstaller/Ruby1.8.7/lib/ruby/gems/1.8
     - C:/Documents and Settings/jeygokul/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/
解决方案

I have fixed this issue by upgrading my RubyGems to 1.8.10 with

gem update --system

Edit: You can also try (as suggested by ZeissS)

gem install rubygems-update
update_rubygems

这篇关于gemspec 中的无效日期格式规范的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 20:23