Quoting Ravi Dtv <[email protected]>:
> undefined method `each' for 4:Fixnum
>
>
> How can I solve this error.
>
What are you trying to do? 'each' is usually applied to an array, a hash, or
a range. It doesn't make sense for a Fixnum. Do you want
irb(main):001:0> 4.times{|i| puts i}
0
1
2
3
=> 4
irb(main):002:0>
or:
irb(main):002:0> (2..4).each{|i| puts i}
2
3
4
=> 2..4
irb(main):003:0>
HTH,
Jeffrey
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.