Я работаю над созданием zip-файла после чтения резюме пользователей. Код работает нормально на локальной машине. Но возникает ошибка при развертывании этого кода на героку.
def get_stream(contractors)
#t = Tempfile.new("my-temp-filename-#{Time.now}") #this code on local
t = Tempfile.new("#{Rails.root}/tmp/my-temp-filename-#{Time.now}") #this line on heroku break
begin
Zip::OutputStream.open(t.path) do |zos|
contractors.each_with_index do |contractor, index|
if contractor.cv.path
zos.put_next_entry("#{index+1}_#{contractor.full_name.parameterize.underscore}.#{contractor.cv_file_name.split(".").last}")
zos.print IO.read(contractor.cv.path)
end
end
end
send_file t.path, :type => 'application/zip', :filename => "Contractors_cvs.zip", :x_sendfile => true
t.close
rescue
t.close
end
конец
в то время как журналы heroku --app просто показывают мне «Завершено 500 внутренних ошибок сервера за 56 мс»
Любая помощь, пожалуйста.
Спасибо