title: ERB: NameError.message creation does not call #to_s on ruby > 2.0.0
body: <p>I am experiencing strange behaviour when using ERB and implementing #to_s - example: </p>
  
  <pre><code>require "erb"
  TEMPLATE = "&lt;%= not_here %&gt;"
  
  class A
    def to_s
      "class &lt;A&gt;"
    end
    def to_str
      to_s
    end
    def render
      begin
        ERB.new(TEMPLATE, nil, '-').result(binding)
      rescue Exception =&gt; e
        print e.to_s
      end
    end
  end
  
  
  A.new().render
  </code></pre>
  
  <p>On ruby 1.9.3 this prints <code>undefined local variable or method 'not_here' for class &lt;A&gt;:A</code>
  On ruby 2.0.0 this prints <code>undefined local variable or method 'not_here' for #&lt;A:0x007f98a29a88b8&gt;</code></p>
  
  <p>Can somebody explain why that is the case and what to do about it in order to get the same output on both ruby versions.</p>