I am new to ruby and trying to use it's csv libary.
The first thing i tried was just to write a simple script:
require "csv"
average_money_spent = Array.new
CSV.foreach('customers.csv', converters: :numeric) do |row|
average_money_spent << row[2] / row[1]
end
This gave the error message: Unclosed quoted field on line 1. So then i tried the exact same thing but require 'csv'. I got this error message: Unclosed quoted field on line 1.
I thought it may be to do with not having CSV gems installed on my ruby so i tried : $ gem install csv
This said it could not be installed: csv requires Ruby version >= 2.5.0dev.
But i tried to install this and checked .. it isn't the latest most stable version of Ruby, the version I have is.
Is there anything I am doing wrong in the way I require csv? Thanks so much for any help. I am new to coding and Ruby.