1

I have set up my github account, configured it with SSH and now I am trying to retrieve group work from gitlab. I have managed to pull the work so that it is on my machine but when I go to bundle install I encounter an error.

It says that I need to install git in order to gems from git repository. I've added an image which might help.

enter image description here

Sprout
  • 630
  • 1
  • 5
  • 22

1 Answers1

3

Check if Git is installed in a folder with spaces or special character.

Try and unzip a recent Git (like PortableGit-2.3.7.1-dev-preview-64-bit.7z.exe) under C:\Git, and add that to your PATH:

set PATH=C:\Git\cmd;%PATH%
bundle install

The PATH issue was mentioned before in issue 5027 and in "Can't run bundle update on Windows".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • @Sprout does `git --version` return 2.3.7 (meaning, does your PATH detects the C:\GIt first)? – VonC May 01 '15 at 12:04
  • It returns: git is not an internal or external recognised command – Sprout May 01 '15 at 12:05
  • 1
    @Sprout So start solving that: unzip Git in `C:\Git`, and type `set PATH=C:\Git\bin;%PATH`, as I mentioned. A `git --version` should then work. And then you can try again the `bundle install`. – VonC May 01 '15 at 12:06
  • Hi VonC, I have already unzipped and installed the PortableGit link you provided and typed the set Path (in my ruby on rails command window, is this correct?) and when I type git --version It is still not recognising the command – Sprout May 01 '15 at 12:10
  • @Sprout that is because `C:\Git\bin` does not contain `git.exe`. Check how the `PortableGit-2.3.7.1-dev-preview-64-bit.7z.exe` has actually been uncompressed under `C:\Git`. – VonC May 01 '15 at 12:11
  • I can't see a git bin folder, here is my explorer window for C:\git http://imgur.com/FajGKqI – Sprout May 01 '15 at 12:14
  • 1
    @Sprout Right, I forgot: `C:\Git\cmd`. I have edited the answer. – VonC May 01 '15 at 12:18
  • Okay, git is now recognised 2.3.7.windows.1 but now the bundle command is no longer recognised as a command – Sprout May 01 '15 at 12:20
  • 1
    @Sprout I forgot a '`%`' in the answer. Open another `cmd` session to see if `bundle install` is recognized there, set your `PATH` in that new session: `set PATH=C:\Git\cmd;%PATH%`, and try again. – VonC May 01 '15 at 12:22
  • Yes, this looks to be working now! I thought it was odd that when I ran the path command I could no longer bundle. – Sprout May 01 '15 at 12:25
  • @Sprout it was because `%PATH` is empty (as opposed to `%PATH%`), so the `PATH` was overridden with just `C:\Git\bin`. – VonC May 01 '15 at 12:26