Comparability Issue rails 4 beta, ruby 2.0.0, mong

2019-03-11 16:18发布

问题:

I am creating a test application using following versions of rails, ruby and mongoid.

rails 4 beta
ruby 2.0.0
mongoid 3.1.2

My GemFile looks like this

gem 'rails', '4.0.0.beta1'
ruby '2.0.0'
gem 'mongoid', '~> 3.1.2'
gem 'bson_ext'

But when i run bundle on console I get following error.

Bundler could not find compatible versions for gem "activemodel":

Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "activemodel":
  In Gemfile:
    mongoid (~> 3.1.2) ruby depends on
      activemodel (~> 3.2) ruby

    rails (= 4.0.0.beta1) ruby depends on
      activemodel (4.0.0.beta1)

Can anyone help? Please.....

回答1:

Use mongoid master from github, that has support for rails 4.0.

gem 'mongoid', git: 'https://github.com/mongoid/mongoid.git'