Rails - Using Tempfile to write on Heroku?

Hello, I need to be able to write a temporary file for use during the
request only.

Locally I can use the following successfully:

    tempfile = File.open(a.original_filename,'w')
      paperclip stuff........

That works great, but not on Heroku… How can I do the above with
Heroku’s restrictions:

I’m not understanding how to translate the above into: #{RAILS_ROOT}/ tmp/myfile_#{Process.pid}

Thanks for any help you can provide here.