When seeding data, I sometimes get an error like this:
Owner(#70279918514200) expected, got String(#70279913263500)
Would it be possible for Rake to tell me what record it is choking on?
EDIT:
This has a little more info on what I’m looking for:
I have a flat file which indicates the data I need. This file was created from an unvalidated database that had many different spelling for things like Proctor (and|y|avec|gen) Gamble. I have been able to translate almost all of them, but there have been some that slip through the cracks and still give me trouble. Would it be possible to see from rake which line of the flat file when I run
flat_file.each_line
is causing trouble?
Try running
rake db:seed --traceto see what line of yourseed.rbfile is failing.Edit #1: Now that I know you’re using
each_line, you may just need to keep a manual count to determine line number.Edit #2: If you’re loading your full file and not streaming it in from its source, you can also get rid of the manual
line_countvariable that you otherwise have to track with a little help from the String#lines method.