Upgrade to Mongoid 6.3.0
Mongoid 6.2 is incompatible with MongoDB 3.6. It seems as though they dropped $pushAll support which Mongoid 6.2 relied on. Mongoid 6.3.0 fixes this and is compatible with MongoDB 3.6. There is a minor configuration change that may not be obvious because Mongoid generates the wrong config parameters.
When you run Mongoid 6.3 with “localhost” in mongoid.yml it throws Address family not supported by protocol family
error and tends to lock up. Regenerating “mongoid.yml” still insists on using “localhost”. It needs to be changed to 127.0.0.1.
Make that simple change and it works fine.
Fixed
Fixed with Mongo 2.5.1 driver update
Emily from MongoDB sent an email about the fix.
I work at MongoDB on the Ruby project and I wanted to let you know that I came across your post: https://davesouth.org/upgrade-to-mongoid-6-3-0
If you don’t mind, I’d like to provide some details: Mongoid doesn’t, in fact, generate the wrong config. You can see the details at this ticket, which is now resolved: https://jira.mongodb.org/browse/RUBY-1285 Basically, the ruby driver was forcing localhost to resolve to ipv4 to circumvent a Windows issue, so you would have trouble connecting if localhost resolved to ipv6 on your machine. Because Windows users represent a small percentage of our total users, I’ve updated this behavior in the latest ruby driver version (2.5.1). Mongoid 6.3.0 with Ruby driver 2.5.1 should totally remove this issue.
Thanks Emily.