Jump to content
  • Advertisement
Sign in to follow this  
K1NNY

How do i run my Ruby programs?

This topic is 2435 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I know i have to use cmd to run my Ruby files but when i try nothing happens. The tutorials say to go into cmd and type "ruby my_program.rb" where "my_program.rb" is my file and ruby is supposed to do something. But when i do this nothing happens and i have my file named correctly. Do i need to have it in a certain place on my computer?

Share this post


Link to post
Share on other sites
Advertisement
When you are trying to run the program from the cmd prompt do you first navigate to the proper directory containing the ruby file? Also make sure it installed properly by typing "ruby -v" on the command prompt.

Share this post


Link to post
Share on other sites
It just keeps saying ruby is not recognized as an internal or external command.

EDIT: Although, when i use the start command prompt with ruby option it give me rubys info when i type ruby -v. Maybe i need to learn how to navigate to the correct directory so lets try that?

Share this post


Link to post
Share on other sites
Haven't used the windows command line much (I use unix/linux) but after looking online a bit typing "cd" with no arguments will give you the directory you are currently working in the you will us cd to change directories.

"cd ../" is up one level from the current location, "cd name" changes to the directory named "name" within the current directory or you could do absolute path such as "cd c:\Users\K1NNY\Documents\Ruby" or wherever your stuff is stored. But you need to run the command in whatever form got ruby to be recognized as a command.

Once you are in the right folder try running the program again

Share this post


Link to post
Share on other sites
No problem. If you are interested here is a very basic introduction to some commonly used command line commands in Windows http://www.bleepingcomputer.com/tutorials/windows-command-prompt-introduction/

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!