I need help with this problem!

Hi! My name is Ricardo and im 15. I decided that i will go to college
study computer science, so i think that is better start learning now,
and get a feedback about programming. I started reading this book :
“Learn to program” by Chris P., and i got to admitt, when i first did
that thing “Hello World” i really love it, but when i got to this part,
things didn’t go very good:

“Now that you’ve gotten everything ready, it’s time to write your first
program! Open your text editor, and type the following:
puts 1+2
Save your program (yep, that’s a complete program!) as calc.rb. Now
run your program by typing ruby calc.rb into your command line. It
should put a 3 on your screen.”

When i opened the command line, and typed calc.rb, it said : “ruby
calc.rb is not recognized as an internal or external command operable
program or batch file”.

Please, i need some help :slight_smile:

2011/11/25 Ricardo N. [email protected]

Save your program (yep, thats a complete program!) as calc.rb. Now

Posted via http://www.ruby-forum.com/.

Sounds like your computer can’t find the ruby executable. IIRC, the
windows
installer should provide a version of the terminal with Ruby in the path
(the path is a list of locations that the computer will look in to find
programs like Ruby). Maybe try going to program files and looking in the
folder for Ruby to see if it has it’s own terminal (not sure what it
would
be called, maybe “system” or something). And then try running it from
there.

Alternatively, there are probably instructions somewhere for how to add
it
to your path (or generally, how to add programs to path if you can’t
find
anything specific)

A quick search just now turned up
http://www.ruby-forum.com/topic/3034898which looks very similar to
your issue. Luis says in there that you can
specify it to be in the path when you install it. So if the above
suggestion doesn’t work, maybe consider reinstalling with those options
checked.

Here are also some tutorials for installing on Windows, if all of the
above
don’t work out Tutorials · oneclick/rubyinstaller Wiki · GitHub

Anyway, good job working ahead :slight_smile: great to see people who care.

Please, i need some help :slight_smile:

You need to install ruby on your computer.

If you use windows, you can use the one-click installer.

It usually installs into /ruby directory.

When i opened the command line, and typed calc.rb, it said : “ruby
calc.rb is not recognized as an internal or external command operable
program or batch file”.

Try “ruby calc.rb” as well. And “irb” too.

It should work on Windows as well.

Remember you need to first make ruby work, before you can run those
scripts!

Ok guys, thank you for your help :smiley: