title: How do I sort an array of hashes by a value in the hash?
body: <p>This Ruby code is not behaving as I would expect:</p>
  
  <pre><code># create an array of hashes
  sort_me = []
  sort_me.push({"value"=&gt;1, "name"=&gt;"a"})
  sort_me.push({"value"=&gt;3, "name"=&gt;"c"})
  sort_me.push({"value"=&gt;2, "name"=&gt;"b"})
  
  # sort
  sort_me.sort_by { |k| k["value"]}
  
  # same order as above!
  puts sort_me
  </code></pre>
  
  <p>I'm looking to sort the array of hashes by the key "value", but they are printed unsorted.</p>