Natalia Natalia - 3 months ago 27
Ruby Question

Where is the CSV gem in Rails?

I’m using Rails 4.2 with Ruby 2.3.0. I want to use the CSV parsing library, which according to the documentation is part of the core Ruby distribution — . However, when I put this on my page

csv = CSV.parse(text_content, :headers => true)

it results in this error

Error during processing: uninitialized constant CsvToActivityConverterService::CSV

Do I need another gem to include the CSV library in my Rails project?


You need to require 'csv' to use it!