Posting multipart to Ruby is annoying to say the least because it isn't implemented in the native libraries. I have had difficulty getting this working correctly even while following the
many methods that have been written about it. So I completely bypass Ruby and use curl to do the posting. It works reasonably well and gets the job done!