title: TypeError: superclass mismatch for class Word in Ruby
body: <p>I am creating a <code>Word</code> class and I am getting an error: </p>
  
  <blockquote>
    <p>TypeError: superclass mismatch for class Word</p>
  </blockquote>
  
  <p>Here is the <em>irb</em> code:</p>
  
  <pre><code>irb(main):016:0&gt; class Word
  irb(main):017:1&gt;  def palindrome?(string)
  irb(main):018:2&gt;   string == string.reverse
  irb(main):019:2&gt;  end
  irb(main):020:1&gt; end
  =&gt; nil
  irb(main):021:0&gt; w = Word.new
  =&gt; #&lt;Word:0x4a8d970&gt;
  irb(main):022:0&gt; w.palindrome?("foobar")
  =&gt; false
  irb(main):023:0&gt; w.palindrome?("level")
  =&gt; true
  irb(main):024:0&gt; class Word &lt; String
  irb(main):025:1&gt;  def palindrome?
  irb(main):026:2&gt;    self == self.reverse
  irb(main):027:2&gt;  end
  irb(main):028:1&gt; end
  TypeError: superclass mismatch for class Word
   from (irb):24
   from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/commands/console.rb:47:in `start'
   from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/commands/console.rb:8:in `start'
   from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.1/lib/rails/commands.rb:41:in `&lt;top (required)&gt;'
   from script/rails:6:in `require'
   from script/rails:6:in `&lt;main&gt;'
  </code></pre>