从Git仓库安装Rails插件

4

我一直在尝试安装Shoulda测试框架。

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 系统上)

2个回答

7

你是否安装了 Git?如果没有安装,这里的操作将不会起作用。Rails 假设 Git 已经安装,并且可以在系统 PATH 中找到。

你可以从 这里 获取 Windows 版本的 Git。


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

抱歉发个新手问题,你如何应用补丁? - hexxen
有一个叫做 patch 的工具可以完成这项工作,但我通常会手动应用补丁,因为那个工具经常对我不起作用。 - Chris Charabaruk

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接