CSV.open("file.csv", "a+") do |csv|
csv << ["cow", "3","2500"]
end
require 'csv'
csv_string = CSV.generate do |csv|
csv << ["row", "of", "CSV", "data"]
csv << ["another", "row"]
# ...
end
CSV.open("filename.csv", "wb") do |row|
row << ["a", "b", "c"]
end