We ran this code last year in using ruby 1.9.3 and Rails 3.0 with no problems, but we now need to run it again this year following an upgrade and it is failing.
The error appears to be around parsing headers when importing a CSV file. The code is
ROOT_DIR = File.expand_path File.dirname(__FILE__)
csv_file = ROOT_DIR + '/holidays_2016.csv'
csv = CSV.read(csv_file, headers: true)
The error returned is
output error: #<NoMethodError: undefined method `table' for #<Object:0x007f82898e15a8>>
removing the headers: true option fixes the problem but I really do need the headers as they are used later in the code !
Aucun commentaire:
Enregistrer un commentaire