# Doesnt work

**URL:** <https://www.ruby-forum.com/t/doesnt-work/94559>\
**Category:** Ruby\
**Created:** [May 7, 2006, 8:20am UTC](https://www.ruby-forum.com/t/doesnt-work/94559 "2006-05-07T08:20:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![corey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/838e76/32.png) [@corey](https://www.ruby-forum.com/u/corey)\
**Post date:** [May 7, 2006, 8:20am UTC](https://www.ruby-forum.com/t/doesnt-work/94559/1 "2006-05-07T08:20:48Z")

</div>

Hello i just started learing ruby tonight but the first little code  
example from the book doesnt work. It creates a ruby file and when i  
click on the ruby file a cmd window opens up and shows me the first line  
"Say something, please: " so i write something there and press return  
and then the cmd window just shuts every time.

print "Say something, please: "  
user\_input = gets.chomp  
print “You said #{user\_input} .\n”  
print “Backwards, it reads #{user\_input.reverse} .\n”  
print “The message is #{user\_input.length} characters long.\n”

---

<div class="post-metadata">

**Author:** ![corey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/838e76/32.png) [@corey](https://www.ruby-forum.com/u/corey)\
**Post date:** [May 7, 2006, 8:31am UTC](https://www.ruby-forum.com/t/doesnt-work/94559/2 "2006-05-07T08:31:42Z")

</div>

nah it works fine. Add another input statement in there to see.  
What’s happening is the output gets displayed, and the window closes  
as soon as the process ends. It’s just too fast for you to see.

Start-\>run “cmd”, and then run your ruby script from in there.

Pat

---

<div class="post-metadata">

**Author:** ![corey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/838e76/32.png) [@corey](https://www.ruby-forum.com/u/corey)\
**Post date:** [May 7, 2006, 8:37am UTC](https://www.ruby-forum.com/t/doesnt-work/94559/3 "2006-05-07T08:37:33Z")

</div>

Pat M. wrote:

> nah it works fine. Add another input statement in there to see.  
> What’s happening is the output gets displayed, and the window closes  
> as soon as the process ends. It’s just too fast for you to see.
> 
> Start-\>run “cmd”, and then run your ruby script from in there.
> 
> Pat

oh ok thanks alot, that worked. Quick response too i was expecting to  
wait lke 24hrs, lol.

Thanks again.

---

<div class="post-metadata">

**Author:** ![corey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/838e76/32.png) [@corey](https://www.ruby-forum.com/u/corey)\
**Post date:** [May 11, 2006, 5:36pm UTC](https://www.ruby-forum.com/t/doesnt-work/94559/4 "2006-05-11T17:36:02Z")

</div>

2006/5/10, Austin Z. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Please note that you are posting through an interface to a mailing  
> list, ruby-talk (removed\_email\_address@domain.invalid). People get your messages in  
> their inboxes and respond to you that way. Some people use another  
> mirror, which is comp.lang.ruby.

Not any more - or at least not at the moment. The gateway was  
switched off AFAIK.

robert

---

<div class="post-metadata">

**Author:** ![corey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/838e76/32.png) [@corey](https://www.ruby-forum.com/u/corey)\
**Post date:** [May 10, 2006, 11:44pm UTC](https://www.ruby-forum.com/t/doesnt-work/94559/5 "2006-05-10T23:44:34Z")

</div>

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

> wait lke 24hrs, lol.  
> Please note that you are posting through an interface to a mailing  
> list, ruby-talk (removed\_email\_address@domain.invalid). People get your messages in  
> their inboxes and respond to you that way. Some people use another  
> mirror, which is comp.lang.ruby.

-austin
