Bundler找不到gem“builder”和“bundler”的兼容版本:

时间:2013-09-16 10:03:17

标签: ruby-on-rails ruby rubygems gem bundler

我几天前才开始使用红宝石。我完全不理解gemfile的概念。我的Gemfile看起来像:

source 'http://rubygems.org'

gem 'sunspot_solr', github: 'sunspot/sunspot', branch: 'master'
gem 'sunspot_rails', github: 'sunspot/sunspot', branch: 'master'

但是在运行“捆绑安装”时。

Bundler could not find compatible versions for gem "builder":
  In Gemfile:
    sunspot_rails (>= 0) ruby depends on
      builder (~> 2.1.2) ruby

    sunspot_rails (>= 0) ruby depends on
      builder (3.2.2)

Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    sunspot_rails (>= 0) ruby depends on
      bundler (~> 1.0.0) ruby

  Current Bundler version:
    bundler (1.3.5)

This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?

我应该安装哪个版本的构建器,因为存在冲突,

2 个答案:

答案 0 :(得分:2)

删除Gemfile.lock并运行bundle install,让Bundler从头开始解析所有依赖项。

答案 1 :(得分:1)

使用

source 'http://rubygems.org'

gem 'sunspot_rails'

gem' sunspot_solr'如上所述here

是可选的