How to Run Ruby and Git Commands in One Place on Windows

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

I run git commands from the CMD session all the time.

Make sure your PATH environment variable includes the 'cmd' directory from a msysgit distro:

Path=C:\Path\To\Git\1.7.1\cmd

If not, add it in your session:

set PATH=%PATH%;C:\Path\To\Git\1.7.1\cmd

and you are done. Git and Ruby commands in your CMD shell.

The reverse (Ruby commands) is possible in a Git bash, by adding to the PATH a value like /c/path/to/Ruby/186-27/bin

http://img842.i_mageshack.us/img842/8749/gitbashruby.png

How to run git command remotely?

If you literally want to run the command remotely, do it over SSH:

ssh username@host "cd my/repo/path && git show"

Command-line Git on Windows

As @birryree said, add msysgit's binary to your PATH, or use Git Bash (installed with msysgit as far as I remember) which is better than Windows' console and similar to the Unix one.

Git Bash giving sh.exe: ruby: command not found

If you already installed ruby, you have to include correct path.

Right click My Computer, click Properties, go to Advanced System Settings left navigation, click on Environment Variables... button, go to System Variables below, select Path, click Edit and in the beginning of the path enter: C:\Ruby200\bin; (Please note that in here you should indicate the ruby executable path. In case you installed ruby using Ruby installer for windows then the above mentioned path is correct).

Hide Command Line when running a Ruby Program

I'm having trouble dissecting the .lnk file, but I believe you can simulate what you want in the command line by running

ruby main.rb &

instead of ruby main.rb. Once you have that, I think you can create a .bat file with the above line and it should run correctly.

Explanation:
The common reason the command prompt runs is because the command prompt is actually running the game inside itself and waiting for you to finish before completing the "run the game" script. The & says "run the game outside of this command prompt (inside a new thread)". Then after creating the new thread, it sees that it has finished execution of the script and closes itself, leaving your game to run on it's own.



Related Topics



Leave a reply



Submit