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')
    tempfile.write_nonblock(a.body)
      paperclip stuff........
    tempfile.close

That works great, but not on Heroku… How can I do the above with
Heroku’s restrictions:
http://docs.heroku.com/constraints#read-only-filesystem

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

Thanks for any help you can provide here.