 <p>As others have pointed out ruby's <code>Symbol#to_proc</code> method is invoked and calls the <code>age</code> method on each hash in the array. The problem here is that the hashes do not respond to an <code>age</code> method.</p> <p>Now we could define one for the Hash class, but we probably don't want it for every hash instance in the program. Instead we can simply define the <code>age</code> method on each hash in the array like so:</p> <pre><code>array.each do |hash| class &lt;&lt; hash def age self[:age] end end end </code></pre> <p>And then we can use <code>group_by</code> just as you were before:</p> <pre><code>array = array.group_by &amp;:age </code></pre>