title: Ruby: Sorting a multidimensional array which may contain nil sometimes fails
body: <p>I found this example in a failing test in one of my projects. Why does this work:</p>
  
  <pre><code>[[1,2,3], [2,3,4], [1,1,nil]].sort
  #=&gt; [[1, 1, nil], [1, 2, 3], [2, 3, 4]]
  </code></pre>
  
  <p>But this does not:</p>
  
  <pre><code>[[1,2,3], [nil,3,4], [1,1,nil]].sort
  #=&gt; ERROR: ArgumentError: comparison of Array with Array failed
  </code></pre>
  
  <p>Tested Ruby versions: <code>2.0.0</code>, <code>1.9.3</code>.</p>