ошибка: неопределенный метод `delete 'для nil: NilClass
"updated_at" => "",
"fias_ao_guid" => "\r\n",
"file_path" => nil
как удалить "\ r \ n"?
splitted_records = []
id = 3141634
string = 0
row = 0
h = {}
record_candidate = {}
open('/home/dayanov-sa/PGadmin/finish.csv') do |csv|
csv.each_line do |line|
index = 0
row += 1
line.split(";").each do |key_filed|
record_candidate["#{key_filed.delete("\r\n")}"] = nil
end if row.eql?(1)
next if row.eql?(1)
copy_object = Marshal.load(Marshal.dump(line))
values = line.split(";")
record_candidate.keys.each do |keys|
index += 1
record_candidate[keys] = values[index].delete("\r\n")
end
id = id + 1
puts string
splitted_records << record_candidate
Я пытаюсь удалить из хеша \ r \ n