Why the speed?

Attention!! Noob warning :slight_smile:

Hello everybody, first of all I just got Ruby v. 1.9.3p374 (latest I
could find), Notepad ++ and the book "Pragmatic Programming 1.9"

And im thinking that im of to a great start. But nooo, whem i make a
very simple prog.

Like:

puts 1+2

and save that as 3.rb then run the prog. It shows for less than a
millisecond which means, I know I did it right but cant see the result
because of the speed...

Arrrgh please help!

Btw cool forum and nice little puzzle to get an account :slight_smile: can麓t wait to
get started and see where Ruby takes me.

-Quale_Boy

路路路

--
Posted via http://www.ruby-forum.com/.

1) there is an newer ruby patchlevel available
2) it looks that you are on windows, you need to call your script from
cmd
otherwise its does not wait for the window to close

路路路

--
Posted via http://www.ruby-forum.com/.

1) do I have to install it, or can I wait?

2) I tried to run it from cmd but this is what i get. (see attatchment)

What do you mean by this?

"otherwise its does not wait for the window to close"

And thank you :slight_smile:

Attachments:
http://www.ruby-forum.com/attachment/8118/Untitled.jpg

路路路

--
Posted via http://www.ruby-forum.com/.

If you installed ruby using the "ruby install for windows", then there's
a special CMD shortcut in the start menu which will correctly interpret
commands like "irb" and instructions to execute a ruby file.
if you want to double-click the file, but not close immediately after
running, then you can add "gets" to the end of your file.

路路路

--
Posted via http://www.ruby-forum.com/.

Good start. You could try method chaining next:

first_name = gets.chomp.capitalize

路路路

--
Posted via http://www.ruby-forum.com/.

Give "ruby test.rb" a try :slight_smile:

Bests:

Zoltan

路路路

On Thu, Feb 7, 2013, at 17:16, Jesper Bukkehave wrote:

2) I tried to run it from cmd but this is what i get. (see attatchment)

"Joel Pearson"

Yessss :slight_smile: very nice! thank you

路路路

--
Posted via http://www.ruby-forum.com/.

Bad practice! That means that you have to press enter always,
even when you run the program from the prompt (which is the
normal way to do it).

I would rather recommend to get acquainted with the command prompt.

stomar

路路路

Am 07.02.2013 17:34, schrieb Joel Pearson:

if you want to double-click the file, but not close immediately after
running, then you can add "gets" to the end of your file.

"Hajd煤 Zolt谩n" <janicetr@fastmail.fm> wrote in post #1095785:

Give "ruby test.rb" a try :slight_smile:

Bests:

Zoltan

Thanks that helped. Im also very new to CMD soooo :)that figures.

I anyone has good advice for an extreme beginner, please don麓t be shy I
want to be good at this.

Besides the book I got I am supplying with this page:

<link>| Codecademy;

It is a very nice step-by-step intro to Ruby. I recommend it for most
beginners like me.

路路路

--
Posted via http://www.ruby-forum.com/\.

I would rather recommend to get acquainted with the command prompt.

stomar

I am already working on it :slight_smile: this is fun.

Fist program finished, it麓s not perfect but I am learning:

print "What's your first name?"
first_name = gets.chomp
first_name.capitalize!
puts "So your name is #{first_name} eh :)"

print "What's your last name?"
last_name = gets.chomp
last_name.capitalize!
puts "Really, interesting!"

print "What city are you from?"
city = gets.chomp
city.capitalize!
puts "I hear that it is very lovely during the summer."

print "What state or province are you from?"
state = gets.chomp
state.upcase!
puts "I did not know that"

puts "So your name is #{first_name} #{last_name} and you're from a city
called #{city}, #{state}!"
gets

Feel free to edit and cut into little pieces.

路路路

--
Posted via http://www.ruby-forum.com/\.