views:

2828

answers:

3

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)

+6  A: 

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.

Jordi Bunster
That and a reboot did. Feel a bit stupid now, but thanks.
Daniel Beardsley
+1  A: 

I have the same problem, already installed msygit and it's on my path. I get the following:

removing: C:/Martin/RailsProjects/ProjectName/vendor/plugins/validates_timeliness /.git

Initialized empty Git repository in C:/Martin/RailsProjects/ProjectName/vendor/plugins/validates_timeliness/.git/

github.com[0: 65.74.177.129]: errno=No such file or directory

fatal: unable to connect a socket (No such file or directory)

A: 

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