# Complete beginner needing help

**URL:** <https://www.ruby-forum.com/t/complete-beginner-needing-help/88211>\
**Category:** Ruby\
**Created:** [March 8, 2007, 11:16pm UTC](https://www.ruby-forum.com/t/complete-beginner-needing-help/88211 "2007-03-08T23:16:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ben](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/df788c/32.png) [@ben](https://www.ruby-forum.com/u/ben)\
**Post date:** [March 8, 2007, 11:16pm UTC](https://www.ruby-forum.com/t/complete-beginner-needing-help/88211/1 "2007-03-08T23:16:35Z")

</div>

Hi, a completly simple question for pretty much everyone on this site.  
I’ve just started to teach myself Ruby and writing some very simple  
programs using the get command. Unfortunately each time I execute the  
program in Scite the command line interface pops up but unfortunately I  
can’t enter any text or numbers??

Any idea why this is happining? The program I executing is below.

# Converts Celsius to Fahrenheit

puts “Enter a temperature in Celsius:”  
cel = gets.to\_f #user types a number  
fahr = (1.8 \* cel) +32 #convert it  
puts “that’s #{fahr} degrees Fahrenheit”

Many thanks

Ben

---

<div class="post-metadata">

**Author:** ![ben](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/df788c/32.png) [@ben](https://www.ruby-forum.com/u/ben)\
**Post date:** [March 8, 2007, 11:32pm UTC](https://www.ruby-forum.com/t/complete-beginner-needing-help/88211/2 "2007-03-08T23:32:26Z")

</div>

Ben wrote:

> cel = gets.to\_f #user types a number  
> fahr = (1.8 \* cel) +32 #convert it  
> puts “that’s #{fahr} degrees Fahrenheit”
> 
> Many thanks
> 
> Ben

Nothing is wrong with your code. AFAIK, that’s just the way Scite  
works. You can run your program but if you want to enter/see the  
input/output you should run it on the command line instead. If you  
memorize the order of your gets then you can type them into the command  
window inside Scite.

Also, I’m not sure how “to\_f” handles newlines, but you may want to use  
gets.strip.to\_f or chop.to\_f just in case.

Raj

---

<div class="post-metadata">

**Author:** ![ben](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/df788c/32.png) [@ben](https://www.ruby-forum.com/u/ben)\
**Post date:** [March 11, 2007, 2:29am UTC](https://www.ruby-forum.com/t/complete-beginner-needing-help/88211/3 "2007-03-11T02:29:42Z")

</div>

Ben wrote:

> cel = gets.to\_f #user types a number  
> fahr = (1.8 \* cel) +32 #convert it  
> puts “that’s #{fahr} degrees Fahrenheit”
> 
> Many thanks
> 
> Ben

It’s the way Scite is handling cmd… What I do on the rare occasion  
that I’m in Windows, is go to start, hit run, type in cmd, hit enter…  
go to whichever directory my code is in, ie. c:\foo and then type at the  
command line: ruby scriptname.rb that way it doesn’t close the command  
box… 🙂

–  
Samantha

[http://www.babygeek.org/](http://www.babygeek.org/)

“Beware when the great God lets loose a thinker on this planet. Then all  
things are at risk.”  
–Ralph Waldo Emerson
