running a simple ruby program

S

Sagy Drucker

hello
i am (very) new at ruby, gotta learn it for my new job..
so please... keep it simple (i'm stupid) and be patient..

so,
i'm copying+pasting a simple ruby class:
class AnimalLottoTicket
....
....
end

and after the class, i'm writing 1 line i want to run, using this
class:
AnimalLottoTicket::NOTES = [:TOOT, :TWEET, :BLAT]

is this the correct way to run a program?

i get the error:
/home/sagy/RubymineProjects/rubyTest/test4.rb:35: Invalid redo
(SyntaxError)

i am using Rubymine... i installed gems version 2.3.1 (or similar) and
i have no idea what that means...
thanks...
 
R

Robert Klemme

hello
i am (very) new at ruby, gotta learn it for my new job..
so please... keep it simple (i'm stupid) and be patient..

Welcome to Ruby!
so,
i'm copying+pasting a simple ruby class:
class AnimalLottoTicket
...
...
end

and after the class, i'm writing 1 line i want to run, using this
class:
AnimalLottoTicket::NOTES = [:TOOT, :TWEET, :BLAT]

is this the correct way to run a program?

Looks OK, although:
i get the error:
/home/sagy/RubymineProjects/rubyTest/test4.rb:35: Invalid redo
(SyntaxError)

i am using Rubymine... i installed gems version 2.3.1 (or similar) and
i have no idea what that means...
thanks...

If we do not know the code (especially around line 35) we have neither.
I'm afraid, you need to share more details.

Kind regards

robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top