I’m using RoR 2.3.8, I want to read a .csv file with is in “path”
def run(filepath, contact_id, filename)
path = "#{filepath}/#{filename}"
Rails.logger.info path
return ["The file "+ filename +" does not exist"] unless File.exist?(path)
CSV.foreach(File.basename(path), {:col_sep => @seperator}) do |row|
When I do that I get this error:
Errno::ENOENT in Admin::RoutesController#status_race
No such file or directory - /Users/anna/Documents/aphroditel/route_finder/arbinet/app/importersQuickcom-Standard-20121107-FULL.csv`
But I’m completely sure that the path is right and the file is there. What I’m missing? Thanks!
Did you try without the
File.basename?