jeudi 7 décembre 2017

Errno::ENOENT No such file or directory @ rb_sysopen ruby on rails

I have the following problem I get read error There is no such file or directory @ rb_sysopen - abc.txt I marked it in the following line 'File.foreach (item) .with_object ([]) do | line, result | 'Idea idea of why that happens and googled and searched the forum and I do not like a function what some people do. I will comment on that folder if this is said .txt

it's probably a silly mistake but I did not locate it it would be very nice a little help

 Dir.foreach("#{Rails.root}/lib/oc/") do |item|
   next unless File.extname(item) == '.txt'
    next if File.directory? item
   puts item
  File.delete(item) if File.exist?(item)
 end  

Aucun commentaire:

Enregistrer un commentaire