Ruby - Enumerable and Collection Processing
Identify the error in this code snippet:
users = [{name: "Sam", age: 25}, {name: "Ann", age: 30}]
sorted = users.sort_by { |user| user.age }