CSV parse error (CONST_MISSING)


I have built a function in my app for the user to parse a CSV file and
store the data in the application’s database. This works great in
Locomotive on my Mac, but the app has been deployed to an IIS server and
no longer works. The error message tells me that active_support is
throwing the error saying there is a CONST_MISSING in one of my methods
(parses the CSV file and prints it to a table for the user to confirm
that their data and layout etc is being read correctly):

def confirm_csv_data
@user_arr = Array.new
index = -1
CSV::Reader.parse(params[:user_csv]) do |row|
index += 1
@user_arr[index] = Array.new
@user_arr[index] << row[0]
@user_arr[index] << row[1]
@user_arr[index] << row[2]

The line with the CONST_MISSING error is this:

CSV::Reader.parse(params[:user_csv]) do |row|

Sorry I can’t show the exact error message I can’t get to the IIS
environment right now.

I’m a bit confused as to how this works on my Mac and not on IIS. As
far as I’m aware the versions of Ruby, Rails etc… are all the same.

Any ideas please? Would appreciate it very much!


Just have a check
require ‘csv’ => true
in the irb terminal of that IIS environment.

If its false, then you need to check the gem.

Also try using Fastercsv.


On Aug 13, 3:23 am, Henry B. [email protected]