Ruby/rails: mongoid with mongo(gem); a bson conflict? How to handle different versions?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-02 06:57:26

问题


How to handle gem version mis-matches?

Mongoid 4.0.0 (latest) uses moped (2.0.0) which requires bson 2.3

Mongo 1.10.2 (latest) uses bson 1.10.2

I can't use mongoid 4.0.0 and mongo 1.10.2 together, but I could in the past, when mongoid uses bson 1.x.

Does anyone know how I can continue forward using both mongo and mongoid?

-daniel

Links:

  • https://rubygems.org/gems/mongoid
  • https://rubygems.org/gems/moped
  • https://rubygems.org/gems/mongo

回答1:


The latest unstable version 2.x (under heavy development) of mongo-ruby-driver uses BSON 2.2. If you upgrade to this Gem you should be good to go.

https://github.com/mongodb/mongo-ruby-driver/blob/master/mongo.gemspec



来源:https://stackoverflow.com/questions/24395147/ruby-rails-mongoid-with-mongogem-a-bson-conflict-how-to-handle-different-ve

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!