-1

I am on a windows 7 box that has msysgit installed. I also have a ruby script where I am trying to invoke git using a system() call.

system("C:/Programs/msysgit/bin/git.exe") 

This does not work. Does anyone know how to get this running? I've done it on Win XP before, but cannot seem to get it working. Any example with ruby/perl/python or similar on windows will help.

ThiefMaster
  • 310,957
  • 84
  • 592
  • 636
dreftymac
  • 31,404
  • 26
  • 119
  • 182
  • Are you sure it's `C:/Programs/` and not `C:/Program Files/`? – ThiefMaster May 11 '11 at 22:39
  • What do you mean it "does not work"? What happened, and what did you expect to happen instead? Error messages? Return values? – Rob Kennedy May 11 '11 at 22:52
  • Expected to see the output of the git commands in the console, instead saw no output. I know ruby is working because the output of my testing "puts(1212)" does show up. I guess I need to look on the windows XP box where the command does work, and see what they PATH= environment variable points to, then make Windows7 do the same – dreftymac May 11 '11 at 23:29
  • This turned out to be the issue: http://stackoverflow.com/questions/3431361/git-for-windows-the-program-cant-start-because-libiconv2-dll-is-missing – dreftymac May 11 '11 at 23:45

3 Answers3

1

you need to be in a working tree of a repository. Or, some git commands allow --git-dir parameter to indicate where the repository is. The current directory that git.exe is running in is probably not a repository.

Adam Dymitruk
  • 124,556
  • 26
  • 146
  • 141
1

If it is in PATH:

`git subcommand`

should work in ruby

manojlds
  • 290,304
  • 63
  • 469
  • 417
0

It turned out to be a missing file, see this post for the issue:

Git for Windows - The Program can't start because libiconv2.dll is missing

Community
  • 1
  • 1
dreftymac
  • 31,404
  • 26
  • 119
  • 182