我有这段代码:
migrate
它正在抛出这个错误:
file = File.open(model_file_path, 'w') do |f|
f << YAML.dump(attributes)
end
s3_bucket.object(filename).upload_file(file)
导致错误的原因是什么?我保存错了吗?
答案 0 :(得分:0)
该文件需要处于打开状态才能上传:
file = File.open(model_file_path, 'w') do |f|
f << YAML.dump(attributes)
end
File.open(model_file_path, 'r') do |f|
s3_bucket.object(filename).upload_file(f)
end