Abh*_*hek 111 rubygems ruby-on-rails
当我尝试在Windows中使用gem时,我收到以下错误,我也提到了 这个stackoverflow帖子和更新的rubygems和rails.但没有什么能解决这个问题.
以下是完整的错误,
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/
小智 132
最终的解决方案是:
在Ruby目录中搜索"spec"文件:*C:\ Ruby187\lib\ruby\gems\1.8\specifications*
如果gemspec文件包含如下内容:s.date =%q {2011-10-13 00:00:00.000000000Z }然后删除00:00:00.000000000Z部分:s.date =%q {2011-10- 13}
保存这些gemspec文件后,问题就解决了.
Rom*_*bes 46
这些解决方案都不适合我.为了修复它,我删除了所提到的目录的所有内容(some/path/to/specification /)然后我安装了我需要的gem(实际上,Bundler然后捆绑安装).
Mic*_*ael 45
我已经修复了这个问题升级我的RubyGems到1.8.10与
gem update --system
Run Code Online (Sandbox Code Playgroud)
编辑:您也可以尝试(根据ZeissS的建议)
gem install rubygems-update
update_rubygems
Run Code Online (Sandbox Code Playgroud)
The*_*per 12
除了运行gem update --system我gem install <gem with bad gemspec>在每个项目上使用的gem env报告为坏.这清理了我机器上的错误.
尝试在Ubuntu 11.10上安装GEM时遇到同样的问题.
Invalid gemspec in [/var/lib/gems/1.8/specifications/svn2git-2.1.2.gemspec]: invalid date format in specification: "2011-12-28 00:00:00.000000000Z"
Run Code Online (Sandbox Code Playgroud)
以上选项对我不起作用.gem env报道如下:
RubyGems Environment:
- RUBYGEMS VERSION: 1.7.2
- RUBY VERSION: 1.8.7 (2011-06-30 patchlevel 352) [i686-linux]
Run Code Online (Sandbox Code Playgroud)
所以我认为这个问题是由于我需要安装更新版本的RubyGems.
发出gem update --system以下警告:
ERROR: gem update --system is disabled on Debian, because it will overwrite the content of the rubygems Debian package, and might break your Debian system in subtle ways. The Debian-supported way to update rubygems is through apt-get, using Debian official repositories.
If you really know what you are doing, you can still update rubygems by setting the REALLY_GEM_UPDATE_SYSTEM environment variable, but please remember that this is completely unsupported by Debian.
Run Code Online (Sandbox Code Playgroud)
但是我终于能够rubygems通过发布以下内容更新到1.8.15:
sudo gem install rubygems-update && update_rubygems
Run Code Online (Sandbox Code Playgroud)
一切顺利,祝你好运!:)