Bundler could not find compatible versions for gem "activemodel"
Asked Answered
E

1

5

Trying to install mongoid 3.1.6 in rails 4.1

Bundler could not find compatible versions for gem "activemodel": In 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)

It works fine when mongoid is downgraded to 1.0.6 but i need to use mongoid 3.1.6 in rails 4.1. Is there any solution to solve this problemt?

Epiphysis answered 11/4, 2014 at 18:53 Comment(0)
T
10

You'll need to use a 4.x version of mongoid, which uses activemodel >= 4.0.0. Here's the latest:

gem 'mongoid', '~> 4.0.0'
Tungstite answered 11/4, 2014 at 19:18 Comment(4)
It works fine thank you, but now i have this error while starting rails server uninitialized constant Sprockets::Rails::VERSION (NameError)Epiphysis
Are you upgrading an existing app from Rails 3.2.x to 4? Or, starting from scratch? I think this is another gem dependency issue somewhere.Tungstite
starting a new application from scratch, using ruby 2.1.1, rails 4.1Epiphysis
Small update on this - authors already released version 4.0.0 of Mongoid gem, for more details see rubygems.org/gems/mongoidAmoral

© 2022 - 2024 — McMap. All rights reserved.