简体   繁体   中英

Installing a rails plugin from a Git repository

I've been trying to install 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. 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). Any ideas about what's going on?

(this is on a windows box)

Do you have git installed? If you don't, it will just not work. Rails assumes git is installed and can be found in your PATH.

You can get Git for Windows here .

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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