mmmm garbage collector deletes it even when there are references to the Tempfile? curious.... Did you try to use an instance variable @ ? Also issues? 

I should try it by myself because using Tempfile seems like a good idean if there is the need to create them, and seems like there is :)