1
我想耙的任務,得到了一些信息,然後寫入本地filesytemrake任務
我想我有這個工作,但不知道如何。
namespace :arc do
task :vday => :environment do
locations=Location.with_current_mec "something"
jt={}
jt[:locations]={}
locations.each do |location|
jt[:locations][location.id]=location.to_small_hash
end
# want this to write to local filesytem
File.write('/Users/jt/output.json', JSON.pretty_generate(jt))
end
end
,然後調用像
heroku run rake arc:vday
但這不是工作,並給我一個錯誤上寫文件。有沒有一種解決方法,讓它寫入我的本地文件系統,而不是heroku?