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

  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
  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:

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

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

Give “ruby test.rb” a try :slight_smile:

Bests:

Zoltan

“Hajdú Zoltán” [email protected] 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:

http://www.codecademy.com/courses/ruby-beginner-en-d1Ylq/2#!/exercises/0

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

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.

“Joel P.”

Yessss :slight_smile: very nice! thank you

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.

It is really nice to be able to learn something like Ruby so fast. So
easy (for now) I started 3 hours ago and now I am able to create very
simple and very small programs. Thanks!

Am 07.02.2013 17:34, schrieb Joel P.:

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.

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

Good start. You could try method chaining next:

first_name = gets.chomp.capitalize