# Im a newb so please help!

**URL:** <https://www.ruby-forum.com/t/im-a-newb-so-please-help/99437>\
**Category:** Ruby\
**Created:** [July 22, 2006, 7:18pm UTC](https://www.ruby-forum.com/t/im-a-newb-so-please-help/99437 "2006-07-22T19:18:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 22, 2006, 7:18pm UTC](https://www.ruby-forum.com/t/im-a-newb-so-please-help/99437/1 "2006-07-22T19:18:15Z")

</div>

Okay so i just got a book call ‘Learn to Program’ by Chris P…  
He suggests using Ruby Interpreter to run any programs i make.  
So the first program he explains to make is a number one.  
I use SciTE text editor and i wrote puts 1+2 and saved it as calc.rb  
just as he said. So he tells me to run it so i go to run and type in  
ruby calc.rb just like he says and something is supposed to come up and  
say 3 but all my pc does is quickly flash my command prompt and then  
nothing happens! How can i fix this? What am i doing wrong?

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 22, 2006, 7:31pm UTC](https://www.ruby-forum.com/t/im-a-newb-so-please-help/99437/2 "2006-07-22T19:31:57Z")

</div>

> So he tells me to run it so i go to run and type in ruby  
> calc.rb just like he says and something is supposed to come  
> up and say 3 but all my pc does is quickly flash my command  
> prompt and then nothing happens! How can i fix this? What am  
> i doing wrong?

Where dit you enter “ruby calc.rb”? In “Start/Run Command”?  
Well, it did exactly what you said. It runs the command.  
Nothing wrong with that.

But if Windows is faster than your eyes (it’s hard to imagine,  
but keep trying…), you should open a DOS-box in which you  
enter the same command. This DOS-box stays alive untill you  
close it by hand (or untill Windows thinks it knows better…).

gegroet,  
Erik V. - [http://www.erikveen.dds.nl/](http://www.erikveen.dds.nl/)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 22, 2006, 7:32pm UTC](https://www.ruby-forum.com/t/im-a-newb-so-please-help/99437/3 "2006-07-22T19:32:25Z")

</div>

On 7/22/06, Karla C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Okay so i just got a book call ‘Learn to Program’ by Chris P…  
> He suggests using Ruby Interpreter to run any programs i make.  
> So the first program he explains to make is a number one.  
> I use SciTE text editor and i wrote puts 1+2 and saved it as calc.rb  
> just as he said. So he tells me to run it so i go to run and type in  
> ruby calc.rb just like he says and something is supposed to come up and  
> say 3 but all my pc does is quickly flash my command prompt and then  
> nothing happens! How can i fix this? What am i doing wrong?

“go to run and type in”, so you’re on some version of Windows? Then,  
go to run and type either ‘command’ or ‘cmd’ to open your command  
shell first. Then in the prompt, type ‘ruby calc.rb’ (depending on  
where  
your file is saved you will need to change to the correct directory  
first,  
e.g. ‘cd Desktop’ then ‘ruby calc.rb’).

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 22, 2006, 7:47pm UTC](https://www.ruby-forum.com/t/im-a-newb-so-please-help/99437/4 "2006-07-22T19:47:40Z")

</div>

another thing you can do is type:

gets

at the end of the program. this will enable you to double click the file  
as you are used to

example:

puts ‘hello world’  
gets

save as hello.rb and window will stay open till you press a key

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 22, 2006, 7:43pm UTC](https://www.ruby-forum.com/t/im-a-newb-so-please-help/99437/5 "2006-07-22T19:43:29Z")

</div>

unknown wrote:

> On 7/22/06, Karla C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Okay so i just got a book call ‘Learn to Program’ by Chris P…  
> > He suggests using Ruby Interpreter to run any programs i make.  
> > So the first program he explains to make is a number one.  
> > I use SciTE text editor and i wrote puts 1+2 and saved it as calc.rb  
> > just as he said. So he tells me to run it so i go to run and type in  
> > ruby calc.rb just like he says and something is supposed to come up and  
> > say 3 but all my pc does is quickly flash my command prompt and then  
> > nothing happens! How can i fix this? What am i doing wrong?
> 
> “go to run and type in”, so you’re on some version of Windows? Then,  
> go to run and type either ‘command’ or ‘cmd’ to open your command  
> shell first. Then in the prompt, type ‘ruby calc.rb’ (depending on  
> where  
> your file is saved you will need to change to the correct directory  
> first,  
> e.g. ‘cd Desktop’ then ‘ruby calc.rb’).

ok thanks it worked!
