I think your csv file has some invalid characters. Change "csv_text" into the follwing line.
csv_text = File.read("#{Rails.public_path}/careersfair.csv")encode("UTF-8", invalid: :replace, undef: :replace, replace: "?")
If you couldn't solve that by this way, I assume the csv file is not UTF-8.
If you're on Linux, try file -i filename.txt
. You can see encoding of the file.
require "iconv"
conv = Iconv.new("UTF-8//IGNORE","ENCODING_OF_YOUR_FILE")
csv_text = File.read("#{Rails.public_path}/careersfair.csv")
text = conv.iconv(csv_text)