# Error

**URL:** <https://www.ruby-forum.com/t/error/135090>\
**Category:** Rails\
**Created:** [April 17, 2008, 7:55pm UTC](https://www.ruby-forum.com/t/error/135090 "2008-04-17T19:55:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![edberner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/f9ae1b/32.png) [@edberner](https://www.ruby-forum.com/u/edberner)\
**Post date:** [April 17, 2008, 7:55pm UTC](https://www.ruby-forum.com/t/error/135090/1 "2008-04-17T19:55:38Z")

</div>

Player model  
def update\_statistics(game)  
for round in game.rounds

…  
end

Why am I getting  
undefined method `each’ for #Round:0x261cc0c  
??

---

<div class="post-metadata">

**Author:** ![edberner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/f9ae1b/32.png) [@edberner](https://www.ruby-forum.com/u/edberner)\
**Post date:** [April 17, 2008, 8:03pm UTC](https://www.ruby-forum.com/t/error/135090/2 "2008-04-17T20:03:17Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

edberner wrote:  
| Player model  
| def update\_statistics(game)  
| for round in game.rounds  
|  
| …  
| end  
|  
| Why am I getting  
| undefined method `each’ for #Round:0x261cc0c  
| ??

Because game is not an Array.

* * *

Phillip G.  
Twitter: [twitter.com/cynicalryan](http://twitter.com/cynicalryan)

~ - You know you’ve been hacking too long when…  
…your speech is punctuated by finger twitches (or arm-waving)  
indicating braces.  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.8 (MingW32)  
Comment: Using GnuPG with Mozilla - [http://enigmail.mozdev.org](http://enigmail.mozdev.org)

iEYEARECAAYFAkgHkLkACgkQbtAgaoJTgL/PoQCeIbFkBWGCAxbBU6mk5riAE0+l  
/qQAnjo2+kmMYmwUNEe0andizb7v7etU  
=oBQs  
-----END PGP SIGNATURE-----

---

<div class="post-metadata">

**Author:** ![edberner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/f9ae1b/32.png) [@edberner](https://www.ruby-forum.com/u/edberner)\
**Post date:** [April 17, 2008, 8:04pm UTC](https://www.ruby-forum.com/t/error/135090/3 "2008-04-17T20:04:27Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

edberner wrote:  
| Player model  
| def update\_statistics(game)  
| for round in game.rounds  
|  
| …  
| end  
|  
| Why am I getting  
| undefined method `each’ for #Round:0x261cc0c

Err, disregard my earlier mail.

round is not an Array or any other Object including Enumerable.

* * *

Phillip G.  
Twitter: [twitter.com/cynicalryan](http://twitter.com/cynicalryan)

~ Hobbes : What if the public doesn’t like your work?  
~ Calvin : They are not supposed to like it. This is avant-garde  
stuff!  
~ I’m criticizing the low brows who can’t appreciate great  
art  
~ like this!  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.8 (MingW32)  
Comment: Using GnuPG with Mozilla - [http://enigmail.mozdev.org](http://enigmail.mozdev.org)

iEYEARECAAYFAkgHkQEACgkQbtAgaoJTgL/nMwCghOKHeBWTS9RVgh4ObCBPFe2/  
7QgAniouxx4jk1RJd1r1joGJAAwf1t5V  
=kjDN  
-----END PGP SIGNATURE-----
