title: rails 3 ruby 1.9.2 CSV "already initialized constant .." warning
body: <p>I want to add the ability to read/write data to a CSV file to one of my models. In versions of ruby prior to 1.9 this would have been done with fasterCSV, but this is now part of ruby. I have the following setup:</p>
  
  <pre><code>#in my_model.rb
  require 'CSV'
  
  class MyModel &lt; ActiveRecord::Base
     ... stuff ...
     def self.dump_to_csv(file=File.join(Rails.root, 'tmp', 'dump', 'my_model.csv'))
        CSV.open(file, "w") do |csv|
           keys = new.attributes.keys
           csv &lt;&lt; keys
           all.each do |m|
              csv &lt;&lt; m.attributes.values_at(*keys)
           end
        end
      end
  end
  </code></pre>
  
  <p>This works fine, however when I come to run tests I get a load of warnings of the form</p>
  
  <pre><code>/Users/x/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/csv.rb:201: warning: already initialized constant VERSION
  /Users/x/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/csv.rb:863: warning: already initialized constant FieldInfo
  /Users/x/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/csv.rb:866: warning: already initialized constant DateMatcher
  ... 
  </code></pre>
  
  <p>How can I remove these warnings?</p>