加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 如何在rails 4中使用mongo_mapper?

发布时间:2020-12-17 03:05:53 所属栏目:百科 来源:网络整理
导读:我试图使用rails 4.0.0与mongo_mapper 0.12.0并获取该消息 Bundler could not find compatible versions for gem "activesupport": In Gemfile: mongo_mapper (~ 0.12.0) ruby depends on activesupport (~ 3.0) ruby rails (= 4.0.0) ruby depends on activ
我试图使用rails 4.0.0与mongo_mapper 0.12.0并获取该消息

Bundler could not find compatible versions for gem "activesupport":
  In Gemfile:
    mongo_mapper (~> 0.12.0) ruby depends on
      activesupport (~> 3.0) ruby

    rails (= 4.0.0) ruby depends on
      activesupport (4.0.0)

Rails 4和mongo_mapper仍然不兼容?

解决方法

Mongomapper 0.12.0不适用于activesupport 4.0.0

你可以在文件mongo_mapper.gemspec上查看它:

s.add_dependency 'activemodel','~> 3.0'

但是你可以使用版本0.13.0.beta2,如果你检查文件mongo_mapper.gemspec:

s.add_dependency 'activesupport','>= 3.0'

所以你需要在你的Gemfile中做

gem 'mongo_mapper','>= 0.13.0.beta2'

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读