There are 3 main culprits to this issue:
First, why do IoAdapters create a new temp file when a target file exists? This should not be the case for FileAdapter and UploadedFileAdapter since they both have a file which can be used directly. This causes RackMultipart files to hang around long after the file has been uploaded to the data store.
Processors are a whole new level of carelessness. https://github.com/thoughtbot/paperclip/blob/master/lib/paperclip/attachment.rb#L396
Since Paperclip::Processor#make recommends returning a tempfile, if you have multiple processors, you'll end up with n-1 (where n is the number of processors) tempfiles that never get cleaned up.
Hopefully I'll have some code to recommend, but I wanted to get this posted so everyone is aware of the issue.
Close and unlink tempfiles after flush write
I've make sure that I close the tempfile in after_flush_writes. Please try to test 3.1.0 when it come out, and let me know if the tempfile is still everywhere.
Thank you for reporting in.