Where do i put scripts to run them from the command line

Hi, a stupid question. I save my scripts in a text editor but in which
directory/file do i save them to run from the command line. It just
gives me an error message when I type - ruby program.rb.

Cheers

What platform are you on?

Hi Leon,

On 19.04.2013 15:49, Leon P. wrote:

Hi, a stupid question. I save my scripts in a text editor but in which
directory/file do i save them to run from the command line. It just
gives me an error message when I type - ruby program.rb.

Cheers

What is the exact error message? Can you start irb?
If you can’t, possibly your OS isn’t able to find the ruby executable.
If you can, are you in the directory where your ruby script is located?

Regards,
Calvin

Try writing:

Dir.pwd

in IRB.

If Windows OP you can put your files anywhere. Just write your file path
to the drive and folder then press enter.
Then ruby and file name .rb.
Or put your ruby program on the desktop and write into the command
prompt cd desktop and press enter key. You should then be on the desktop
which means you can then write ruby and your program file name .rb and
press the enter key.
Take a look at some basic ruby @ http://www.oldkingjames.org