升级gem到1.3.0后,直接建项目都出问题,执行除gem -v命令外的所有gem命令均出现下述问题,rubyforge如是解决,测试生效,备份。

地址:http://rubyforge.org/track...

[#22226] RubyGems 1.3 fails on windows (undefined method `uid' for nil:NilClass)
Date:
2008-09-29 16:30   Priority:
3
Summary:
RubyGems 1.3 fails on windows (undefined method `uid' for nil:NilClass)

Detailed description

Gem 1.3 does not work out of the box on windows.

Here is what happens:

C:\>gem update
Updating installed gems
ERROR:  While executing gem ... (NoMethodError)
   undefined method `uid' for nil:NilClass

The problem is in C:\ruby\lib\ruby\site_ruby\1.8\rubygems.rb, line 713:

"if 0 == File.expand_path(path).index(Gem.user_home) and Etc.getpwuid.uid != File::Stat.new(Gem.user_home).uid
then"

Which should be replaced with:

"if 0 == File.expand_path(path).index(Gem.user_home) and !Gem.win_platform? and Etc.getpwuid.uid
!= File::Stat.new(Gem.user_home).uid then"

Then everything works as expected.
Tags: ,
Ruby | 评论(1) | 引用(0) | 阅读(1671)
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]
               

验证码 请输入左侧的字母,不区分大小写