How to run Ruby and GIT commands in one place on Windows

Viewed 28595

I have Ruby and GIT installed on my windows box. To run GIT commands I am utilizing the GIT Bash. To run Ruby commands I am using the command line.

I have not been successful running GIT commands from the CMD line nor can I seem to run Ruby commands from inside the GIT Bash. I would love to be able to run commands for both GIT and Ruby from the GIT Bash (ideal) or at the least from the CMD line.

What is the best way to go about this?

6 Answers

To elaborate on VonC's answer of making Ruby available in Git-Bash.

All you have to do is add the path to your Ruby bin folder in your windows environment variables. It doesn't have to be in the format /c/path/to/ruby, it can be C:\Ruby193\bin.

Step by step for Windows 7:

  1. Start
  2. Search programs and files (default textbox after hitting the Start icon), Search for 'environment'
  3. Select 'edit the system environment variables'
  4. Click 'Environment Variables' (bottom right of the form)
  5. Add to the 'System Variables' 'PATH' the following ';C:\Ruby193\bin' (without the single quotes)
  6. Restart your shell

Make sure to close your git-bash shell and restart it to pick up the new environment variable.

Related