4

我一直在尝试安装应该

script/plugin install git://github.com/thoughtbot/shoulda.git

但我得到的是:

removing: C:/Documents and Settings/Danny/My Documents/Projects/Ruby On Rails/_ProjectName_/vendor/plugins/shoulda/.git
>

而且vender/plugins目录是空的。我将 Rails 2.1.1 作为 gem 安装,并验证了 2.1.1 已加载(使用插入到 config/boot.rb 的 puts)。关于发生了什么的任何想法?

(这是在一个 Windows 盒子上)

4

2 回答 2

7

你有安装 git 吗?如果你不这样做,它就行不通。Rails 假定 git 已安装并且可以在您的 PATH 中找到。

您可以在此处获取适用于 Windows 的 Git 。

于 2008-10-23T20:35:37.250 回答
0

对于仍然有这个问题的人,从 Rails 2.3.5 开始,您可能仍然会遇到错误,因为最近的 Ruby/Win32 构建是使用 MinGW 完成的。但是,该问题已在 2.3.8 之间修复,只要您此时安装了 msysgit,它应该可以正常工作。

如果您对升级不满意(来吧,这只是一点点发布),以下补丁将处理这些问题:

--- reporting.rb.orig   2010-06-11 01:00:24.739991600 -0400
+++ reporting.rb        2010-06-18 00:16:39.517649400 -0400
@@ -35,7 +35,7 @@
   #   puts 'But this will'
   def silence_stream(stream)
     old_stream = stream.dup
-    stream.reopen(RUBY_PLATFORM =~ /mswin/ ? 'NUL:' : '/dev/null')
+    stream.reopen(RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'NUL:' : '/dev/null')
     stream.sync = true
     yield
   ensure
@@ -56,4 +56,4 @@
       raise unless exception_classes.any? { |cls| e.kind_of?(cls) }
     end
   end
-end
\ No newline at end of file
+end
于 2010-06-18T04:25:33.790 回答