# I need help with DOS commands so I can learn ruby [Help!]



## midarkmind (Jul 3, 2011)

Hello, I am in need of some assistance with trying to get my fist ruby program to run. I am reading the book "Learn to program by chris pine" and he seems to be using a different DOS version them me. I think hes on a mac or using an XP version. His says version is "Microsoft Windows XP [Version 5.1.2600] 1985-2001 Microsoft Corp. I am running windows 7, my version is 6.1.7601 2009. Anyways the commands that he is telling me are not adding up. I tried the ruby -v to see if ruby was installed and the error I got was that it was not recognized in dos as an internal or external command? When I tried to go to the programs folder dos says it can't find it. When I saved my calc.rb file and tried to run it with ruby calc.rb DOS didn't recognize the command ether. I was in the correct directory. What could be the issue?


----------



## Squashman (Apr 4, 2003)

The version of the operating system is not your problem.

Are you positive Ruby is installed and what directory is it installed in?

If it is installed, is the Ruby executable in your PATH variable so it knows where to find it? Type PATH at a cmd prompt. Is the directory that Ruby is installed to, listed as one of the directories in the PATH?


----------



## midarkmind (Jul 3, 2011)

Thanks I already figured that out. I was using the wrong CMD. Ruby installs with its own command prompt. If I use the windows DOS then I am sitting feeling hopelessly stupid. My book that I was using to learn didn't exactly tell me about that step so I never noticed that before. Thanx.


----------



## Squashman (Apr 4, 2003)

If you installed with the Windows Installer it prompts you to add the install path of RUBY to your executable path. Going to assume you did not check this box because it is not checked by default.

Ruby does not install its own cmd prompt. When you launch the Ruby.exe (Start cmd prompt with Ruby) from the Start Program Menu it just opens to a Windows cmd prompt and adds the directory where Ruby is installed to the PATH variable. If you look at the properties of that shortcut in your start programs menu you will see that it is opening the cmd prompt and launching a batch file to set the environmental variables for the executable search PATH.


----------

