I\'m having an issue with FasterCSV and my rake db:seeds migration. I get the error: \"rake aborted! Unquoted fields do not allow \\r or \\n (line 2)\" on the following se
It was as simple as clearing all the formatting off in the csv. Excel seems to have a habit of retaining a lot of the formatting after saving in a csv file, which was causing the failure. After I copied and pasted all the data with no formatting in a new csv file, it was fine.
I do not have enough reputation to comment, but I wanted to say that I have been looking this error across the web day and night for a long time and finally found the solution in the comments, by mu is too short.
I finally got it to work when I put quotes around all of my values.
EDIT: Link to answer!!! Rails FasterCSV "unquoted fields do not allow \r or \n"
Use String.encode(universal_newline: true)
instead gsub.
It converting CRLF and CR to LF # Always break lines with \n