title: write csv in ruby 1.9 and CSV::Writer
body: <p>i have a code that works fine with ruby 1.87 but dont works with ruby 1.9. It says that CSV::Writer is undeclared but it still part of the rdoc. Does the csv api changed, after the fastercsv merge, or not?</p>
  
  <p>my code:</p>
  
  <pre><code>require 'csv'
  
  def self.export_csv
   file_name = File.join(RAILS_ROOT, 'public','csv',"#{start_date_f}_#{end_date_f}.csv")
   return file_name if File.exist?(file_name)
   @results = find(:all)
   header_row = []
   outfile = File.open(file_name, 'wb')
   CSV::Writer.generate(outfile) do |csv|
        header_row = ['gateway_id','created', 'gateway_status_id', 'panel_id',  'panel_status','volts_out', 'amps_out', 'temp','aid' ,'sid', 'pisid']
        csv &lt;&lt; header_row
    end
  end
  </code></pre>
  
  <p>The error that i receive: NameError: uninitialized constant CSV::Writer</p>
  
  <p>Note that require 'csv' is there. i try it in my console, when i do the require 'csv', it works, but as soon as i call CSV::Writer i receive that error. 
  This code works fine with ruby 1.87, so it makes me think that it is a ruby 1.9 csv problem since it was merged with fasterCSV.</p>