简体   繁体   English

从Git存储库安装rails插件

[英]Installing a rails plugin from a Git repository

I've been trying to install Shoulda 我一直在尝试安装Shoulda

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

but all I get is: 但我得到的是:

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

And the vender/plugins directory is empty. 并且vender/plugins目录为空。 I have Rails 2.1.1 installed as a gem and have verified that 2.1.1 is loaded (using a puts inserted into config/boot.rb). 我将Rails 2.1.1安装为gem并验证了2.1.1已加载(使用put插入config / boot.rb)。 Any ideas about what's going on? 关于发生了什么的任何想法?

(this is on a windows box) (这是在一个窗户框上)

Do you have git installed? 你有安装git吗? If you don't, it will just not work. 如果你不这样做,那就行不通了。 Rails assumes git is installed and can be found in your PATH. Rails假设安装了git并且可以在PATH中找到。

You can get Git for Windows here . 你可以在这里获得Git for Windows。

For folks still having this problem, as of Rails 2.3.5 you are likely to get an error still, as recent Ruby/Win32 builds are done with MinGW. 对于仍然存在这个问题的人来说,从Rails 2.3.5开始,你很可能会得到一个错误,因为最近的Ruby / Win32版本是用MinGW完成的。 However, the problem's been patched between there and 2.3.8, and so long as you have msysgit installed at this point, it should Just Work. 但是,问题已经在那里和2.3.8之间进行了修补,只要你在这一点上安装了msysgit,就应该Just Work。

If you're not comfortable with upgrading (c'mon, it's just a little point release) the following patch will handle things: 如果您对升级不满意(来吧,这只是一点点发布),以下补丁将处理:

--- 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM