Connection reset by peer - Always the same but just for me

Could you use something like Wireshark to intercept the packets and compare the cURL one against the Ruby one. The stack trace isn’t really giving you enough information here.