title: undefined local variable or method `column' for main:Object when running csv import via rake
body: <p>I am trying to learn Rails and one of the first exercises I wanted to lear was to automate csv import into database. So I created the model by using</p>
  
  <pre><code>rails g scaffold Domain  dns:string current_bid:integer join_by_pt:datetime bidders:integer seller:string tld:string length:integer words:string categories:string hyphnens:string numbers:string auction_type:string
  </code></pre>
  
  <p>Next I created the rake file:</p>
  
  <pre><code>require 'csv'
  
  desc "Import domains from csv file"
    task :import =&gt; [:environment] do
  
    file = "db/dl.txt"
  
    CSV.foreach(file, :headers =&gt; true) do |row|
    entry = Domain.find_or_create_by(:dns =&gt; column[1])
    entry.bid = column[2]
    entry.join_date = DateTime.parse(column[3])
    entry.bidders = column[4]
    entry.seller = column[5]
    entry.tld = column[6]
    entry.length = column[7]
    entry.words = column[8]
    entry.categories = column[9]
    entry.hyphens = column[10]
    entry.numbers = column[11]
    entry.auction_type = column[12]
    entry.save 
   end
  
  end
  </code></pre>
  
  <p>But when I try to run it, I get the error:</p>
  
  <pre><code>&gt; rake aborted! undefined local variable or method `column' for
  &gt; main:Object /Users/user/drop/lib/tasks/import.rake:9:in `block (2
  &gt; levels) in &lt;top (required)&gt;'
  &gt; /Users/uer/drop/lib/tasks/import.rake:8:in `block in &lt;top (required)&gt;'
  </code></pre>
  
  <p>Any pointers as to what I am doing wrong and where my line of thinking went to the wrong direction please?</p>
  
  <p>Thank you</p>