我正在使用 RoR 2.3.8,我想读取一个位于“路径”中的 .csv 文件
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|
当我这样做时,我收到此错误:
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`
但我完全确定路径是正确的并且文件在那里。我错过了什么?谢谢!