From: Phrogz Date: 2007-01-11T05:55:12+09:00 Subject: Re: Undefined Method `free' Mike Keller wrote: [snip] > However whenever I run the script I get the following > error: > csvadd.rb:27: undefined method `free' for nil:NilClass (NoMethodError) > from csvadd.rb:12:in `with_db' > from csvadd.rb:21 [snip] > res = db.query('load data local infile \'/full/path/to/csvdoc.csv\' > into table mytable fields teminated by \',\' lines teminated by \'\n\' > ignore 1 lines') > > res.free [snip] What that means is that on line 27, you are calling "free" on a nil object. Which means that 'res' is a nil object. Which means that db.query(...) is returning nil.