title: Heroku, CarrierWave, MiniMagick: random tmp file missing
body: <p>in my RoR project I am using CarrierWave + MiniMagick and deployed to Heroku for production.</p>
  
  <p>I have this problem in production that sometimes the tmp file is missing for image processing. I get this error:</p>
  
  <p><code>Errno::ENOENT: No such file or directory - /tmp/mini_magick20130319-2-3wq6l6.jpg</code> </p>
  
  <p>I have other XUploader classes that works but this particular one have two image processes. Initially I had two separate process for this:</p>
  
  <pre><code>  process :resizer
    def resizer
      resize_to_fit(model.jrac_image_width, model.jrac_image_height)
    end
  
    process :cropper
    def cropper
      manipulate! do |img|
        img.crop("442x190+#{model.jrac_crop_x}+#{model.jrac_crop_y}")
        img
      end
    end
  </code></pre>
  
  <p>but it said I was having error on <code>:cropper</code> saying the tmp file doesn't exist. I tried to change the code to this, hopefully it will only work on it once:</p>
  
  <pre><code>  process :resize_and_crop
    def resize_and_crop
      manipulate! do |img|
        img.resize("#{model.jrac_image_width}x#{model.jrac_image_height}") # resize_to_fit
        img.crop("442x190+#{model.jrac_crop_x}+#{model.jrac_crop_y}") # cropper
        img
      end
    end
  </code></pre>
  
  <p>but unfortunately, still experiencing the same errors.</p>
  
  <p>Does anyone have any idea where the problem is? I don't know if it's with Heroku or CarrierWave or ImageMagick?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>I also have this code on my <code>Uploader</code> class</p>
  
  <pre><code>  def cache_dir
      "#{Rails.root}/tmp/uploads"
    end
  </code></pre>
  
  <p>as for this <a href="https://github.com/jnicklas/carrierwave/wiki/How-to%3a-Make-Carrierwave-work-on-Heroku" rel="noreferrer">document</a>.</p>