title: Undefined method error for CSV class
body: <p>I am following this tutorial for exporting CSV:</p>
  
  <p><a href="http://railscasts.com/episodes/362-exporting-csv-and-excel" rel="nofollow">http://railscasts.com/episodes/362-exporting-csv-and-excel</a></p>
  
  <p>However, I am getting an "undefined method '&lt;&lt;' for CSV:Class</p>
  
  <p>The code snippet being highlighted in the error is:</p>
  
  <pre><code>def self.to_csv
    CSV.generate do |csv|
      CSV &lt;&lt; column_names #this row is highlighted in the error
      all.each do |opportunity|
        CSV &lt;&lt; product.attributes.value_at(*column_names)
      end
    end
  end 
  </code></pre>
  
  <p>My config/application:</p>
  
  <pre><code>require 'rails/all'
  require 'csv'
  </code></pre>
  
  <p>Thanks!
  Please note that I am only 2:30 into the video. </p>