In a multithreaded environment the latest version crashes with IOError (stream closed) here:
https://github.com/mongodb/mongo-ruby-driver/blob/master/lib/mongo/util/pool.rb#L220
I'm not familiar with the mongo driver internals, therefore I just did a workaround by changing the line to:
socket.close if socket and !socket.closed?
It was working before, but unfortunately I cannot pinpoint the version it became broken.