5

尝试在 rails 4.1 中安装 mongoid 3.1.6

Bundler 找不到 gem "activemodel" 的兼容版本:在 Gemfile 中:

mongoid (~> 3.1.6) ruby depends on
  activemodel (~> 3.2) ruby

rails (= 4.1.0) ruby depends on
  activerecord (= 4.1.0) ruby depends on
    activemodel (4.1.0)

当 mongoid 降级到 1.0.6 时它工作正常,但我需要在 rails 4.1 中使用 mongoid 3.1.6。有什么办法可以解决这个问题吗?

4

1 回答 1

10

您需要使用 4.x 版本的 mongoid,它使用activemodel >= 4.0.0. 这是最新的:

gem 'mongoid', '~> 4.0.0'
于 2014-04-11T19:18:24.010 回答