i 拥有一部与废墟1.87做罚款的法典,但与废墟1.9做工。 它说,CSV:Writer虽未申报,但仍属于教义的一部分。 在迅速合并后, c虫是否发生了变化?
我的法典:
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 << header_row
end
end
收到以下错误:姓名:未开始的普通社会保障金:
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.