无法解析gem依赖

时间:2012-10-22 09:42:23

标签: ruby rubygems sinatra bundler

我似乎无法解决此依赖关系。我已经尝试明确地在Gemfile中设置版本,但似乎没有任何效果。有什么想法吗?

Gem::LoadError: Unable to activate activemodel-3.2.8, because builder-3.1.3 conflicts with builder (~> 3.0.0)
~/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1637:in `raise_if_conflicts'
~/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:746:in `activate'
~/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:51:in `block in require'
~/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:50:in `each'
~/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:50:in `require'

这是我的Gemfile

# encoding: UTF-8
source :rubygems
source :gemcutter
source :rubyforge

gem 'sinatra'
gem 'mongoid', '~> 2.4'
gem 'mongo', '1.6.2'
gem 'bson_ext', '~> 1.5'
gem 'builder', '~> 3.0.0'
gem "mongoid-history"
gem "mongoid-rating"
gem "mongoid_vote"
gem "geocoder"
gem "slim"
gem "sidekiq"
gem "sprockets" #required by sidekiq for some reason...
gem "logger"
gem "carrierwave"
gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid'
gem "mongoid-history"
gem "airbrake"

1 个答案:

答案 0 :(得分:3)

主要是因为Mongoid(> 3.0是我犯过这个错误)具有active_model ~> 3.1 gem的依赖关系,其中inturn依赖于builder ~> 3.1。删除Gemfile中的builder条目,删除Gemfile.lock并运行bundle