4

Okay, I know this is a bit of a simple question, but I can't seem to get it to work. I have installed the SmarterCSV gem in my Rails 4 app and am trying to use it in my controller like so:

SmarterCSV.process("/files/csv_file.csv")

I can do this exact process in the rails console for this app, but I cannot seem to get it to work in my controller. Every time I just get the Rails Dead Screen saying uninitialized constant MyController::SmarterCSV. I have tried adding the line

require 'smarter_csv'

But that also breaks to the Rails Dead Screen with the error cannot load such file -- smarter_csv

Any help would be greatly appreciated, Im not entirely sure what I can do...

Zubatman
  • 1,235
  • 3
  • 17
  • 34

2 Answers2

0

you can try require 'smarter_csv/smarter_csv' as this is the path of the file in the gem https://github.com/tilo/smarter_csv/blob/master/lib/smarter_csv/smarter_csv.rb

bigsolom
  • 2,309
  • 1
  • 19
  • 15
0

Don't forget to restart your application after bundle install

Ahmed Kamal
  • 561
  • 6
  • 17