I have a job, the code is:
class Job
@queue = :default
class << self
def perform
temp_file = Rails.root.join('tmp', 'my_temp_file')
return if File.exist?(temp_file)
FileUtils.touch(temp_file)
begin
# ....
ensure
FileUtils.rm(temp_file)
end
end
It's perfectly fine on local, but fails on travis with:
Failure/Error: LateNotificationJob.perform
Errno::ENOENT:
No such file or directory @ rb_sysopen - /home/travis/build/something/something/tmp/my_temp_file
What is the solution? Please help!