From: "ToMaTo@..." Date: 2011-11-20T13:22:36+09:00 Subject: Re: How to run a program (Newbie) --0016364269a13d73b104b222ebee Content-Type: text/plain; charset=ISO-8859-1 Hi, You can do it like this: Open windows command line interface then type "ruby C:\Users\Otto\the\path\to\your\ruby\file" When navigating to your ruby file, you can use tab key to automatically complete the path. Hope it helps. On Sat, Nov 19, 2011 at 11:09 PM, Otto Dydakt wrote: > Another newbie question here: > > So: I've installed ruby. I've got the command prompt set up. If I run > "puts 1" it returns "1" and "puts 1+2" returns 3. All seems good. > > Then I use SciTE to write a program called "calc.rb" The only line in > "calc.rb" is "puts 1+2" and I expect that it will return "3" > > I get to the command prompt, which says "C:\Users\Otto>" > > I type "irb" to get into the ruby prompt, changing the prompt to > "irb
:001:0>" > > The question is: how do I run the calc.rb program? > > My tutorial book says that I should type "ruby calc.rb" but this returns > "NameError: undefined local variable or method 'calc' for main:Object > from :1 > > What am I doing wrong? > > -- > Posted via http://www.ruby-forum.com/. > > -- Life is a miracle. --0016364269a13d73b104b222ebee--