title: Ruby: comparison of String with String failed (ArgumentError)
body: <p>Here is my ruby code:</p>
  
  <pre><code>books = ["Charlie and the Chocolate Factory", "War and Peace", "Utopia", "A Brief History of Time", "A Wrinkle in Time"]
  
  books.sort! {
  
    |firstBook, secondBook|
    boolean_value = firstBook &lt;=&gt; secondBook
    print "first book is =  '#{firstBook}'"
    print " , second book is = '#{secondBook}'"
    puts  " and there compare result is #{boolean_value}"
  
  }
  </code></pre>
  
  <p><strong>Questions:</strong></p>
  
  <ol>
  <li>This code runs single iteration and then it gives error <code>in 'sort!': comparison of String with String failed (ArgumentError)</code></li>
  <li>When <strong>firstbook =  "Charlie and the Chocolate Factory"</strong> then <strong>secondBook should be  "War and Peace"</strong> but it code chooses <strong>"Utopia" to compare. Why?</strong></li>
  </ol>