Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

running a simple ruby program

46 views
Skip to first unread message

Sagy Drucker

unread,
Jan 10, 2012, 1:39:30 PM1/10/12
to
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...

Robert Klemme

unread,
Jan 10, 2012, 2:55:20 PM1/10/12
to
On 10.01.2012 19:39, Sagy Drucker wrote:
> 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

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
0 new messages