On Jan 24, 6:03 pm, David Kahn <[email protected]> wrote:
> The following code works locally (parsing a CSV with specific headers) but
> when on Heroku I get the following error on the 'next if' row:
>
> TypeError (can't convert String into Integer)
>
>     CSV.parse(File.open(file_path, 'r').read.gsub(/"/, ''), :headers =>
> true) do |row|
>       next if row['Customer'] && row['Customer'].strip == '. standard note
> format'
>       ...
>     end
>
> So, before I rewrite my code and pull out named columns and just use
> integers (named columns certainly makes life easier) as the error message is
> suggesting, does anyone have an idea why this would be happening?
>
> Rails 3.0.3, Ruby 1.9.2

Is it definitely ruby 1.9.2 locally and on heroku ? in 1.9.2 CSV is
actually the library previously known as fastercsv, which has slightly
different semantics in places

Fred

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to