I need to create a repeating task that creates (or edits) product records from an external text file. Inside irb:
>> f = File.open(<filename>)
No problems.
But when you insert a Rake task into the file, the script always bombes "File not found." (Rails 3.1, Ubuntu.)
namespace :sap do desc "uploads data from raw SAP file" task :upload => :environment do f = File.open("sap_pnlist_20111010a.csv") records = f.readlines records.each {|row| ... etc etc ... } end end
Suggestions?
source share