Heroku uses what is called an ephemeral filesystem. This means that your local filesystem is only accessible to a single dyno, and once the dyno is stopped, restarted, or moved, all files on the local filesystem are destroyed.
The only way for your Delayed Job process to transfer files to an outside process would be to store the files in a more permanent location. This could be S3, a database, Rackspace Files, etc, but for Heroku it cannot be the local filesystem.
However, if you are just looking to store the file in a temporary scratch location, it is fine to use the local filesystem. It looks like you may be having issues because the /app/tmp
directory may not exist.
Try adding this to your worker:
Dir.mkdir(Rails.root.join('tmp'))
Or, add the tmp
directory to your git repository.
mkdir tmp
touch tmp/.keep
git add tmp/.keep
git commit -m "Add tmp directory to app repository."