Ruby2Exe with Rails is not cleaning the temp files

I packed a Rails application using the instructions from the excellent
Ruby2exe page. However, when I run the exe, use the application and then
hit Ctrl-C to finish the application, Ruby2Exe and tar2ruby do not
clean the temp files they created. Any way of making Ruby2Exe clean the
temp files when the Rails application ends?

Best regards,
Juan

Found the solution. I am posting the solution at