Bundler不会让我安装宝石

时间:2013-02-06 23:04:48

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

每当我尝试运行rspec测试时,我都试图消除这些恼人的DEPRECATION WARNINGS(我正在通过Rails教程跋涉)。

我尝试按照此处的建议:rspec triggers "DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically."只是更新我的rspec版本。

然而,无论何时尝试,我都会得到这样的信息:

The bundle currently has rspec-core locked at 2.1.0.
Try running `bundle update rspec-core`

或者这个:

Bundler could not find compatible versions for gem "rspec-core":
  In Gemfile:
    rspec-rails (= 2.1.0) x86-mingw32 depends on
      rspec-core (~> 2.1.0) x86-mingw32

    rspec-core (2.10.1)

最后,我继续点击bundle install来更新我的所有宝石。然而,这产生了不更新那些rspec的精彩结果。这是怎么回事? (而且我一直在更新我对当前git分支的提交。)

谢谢。

编辑:这是我的gemfile和gemfile.lock的样子:

source 'https://rubygems.org'

gem 'rails', '3.2.1'

group :development, :test do
    gem 'sqlite3', '1.3.5'
    gem 'rspec-rails', '2.1.0' #NOTICE: possible error with rails version
end

group :assets do
  gem 'sass-rails',   '~> 3.2.5'
  gem 'coffee-rails', '~> 3.2.2'    
  gem 'uglifier', '1.2.3'
end

gem 'jquery-rails', '2.0.2'

group :test do
  gem 'capybara', '1.1.2'
end

group :production do
  gem 'pg', '0.12.2'
end

我的gemfile.lock:

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (3.2.1)
      actionpack (= 3.2.1)
      mail (~> 2.4.0)
    actionpack (3.2.1)
      activemodel (= 3.2.1)
      activesupport (= 3.2.1)
      builder (~> 3.0.0)
      erubis (~> 2.7.0)
      journey (~> 1.0.1)
      rack (~> 1.4.0)
      rack-cache (~> 1.1)
      rack-test (~> 0.6.1)
      sprockets (~> 2.1.2)
    activemodel (3.2.1)
      activesupport (= 3.2.1)
      builder (~> 3.0.0)
    activerecord (3.2.1)
      activemodel (= 3.2.1)
      activesupport (= 3.2.1)
      arel (~> 3.0.0)
      tzinfo (~> 0.3.29)
    activeresource (3.2.1)
      activemodel (= 3.2.1)
      activesupport (= 3.2.1)
    activesupport (3.2.1)
      i18n (~> 0.6)
      multi_json (~> 1.0)
    arel (3.0.2)
    builder (3.0.4)
    capybara (1.1.2)
      mime-types (>= 1.16)
      nokogiri (>= 1.3.3)
      rack (>= 1.0.0)
      rack-test (>= 0.5.4)
      selenium-webdriver (~> 2.0)
      xpath (~> 0.1.4)
    childprocess (0.3.7)
      ffi (~> 1.0, >= 1.0.6)
    coffee-rails (3.2.2)
      coffee-script (>= 2.2.0)
      railties (~> 3.2.0)
    coffee-script (2.2.0)
      coffee-script-source
      execjs
    coffee-script-source (1.4.0)
    diff-lcs (1.1.3)
    erubis (2.7.0)
    execjs (1.4.0)
      multi_json (~> 1.0)
    ffi (1.3.1-x86-mingw32)
    hike (1.2.1)
    i18n (0.6.1)
    journey (1.0.4)
    jquery-rails (2.0.2)
      railties (>= 3.2.0, < 5.0)
      thor (~> 0.14)
    json (1.7.6)
    mail (2.4.4)
      i18n (>= 0.4.0)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    mime-types (1.20.1)
    multi_json (1.5.0)
    nokogiri (1.5.6-x86-mingw32)
    pg (0.12.2-x86-mingw32)
    polyglot (0.3.3)
    rack (1.4.4)
    rack-cache (1.2)
      rack (>= 0.4)
    rack-ssl (1.3.3)
      rack
    rack-test (0.6.2)
      rack (>= 1.0)
    rails (3.2.1)
      actionmailer (= 3.2.1)
      actionpack (= 3.2.1)
      activerecord (= 3.2.1)
      activeresource (= 3.2.1)
      activesupport (= 3.2.1)
      bundler (~> 1.0)
      railties (= 3.2.1)
    railties (3.2.1)
      actionpack (= 3.2.1)
      activesupport (= 3.2.1)
      rack-ssl (~> 1.3.2)
      rake (>= 0.8.7)
      rdoc (~> 3.4)
      thor (~> 0.14.6)
    rake (10.0.3)
    rdoc (3.12.1)
      json (~> 1.4)
    rspec (2.1.0)
      rspec-core (~> 2.1.0)
      rspec-expectations (~> 2.1.0)
      rspec-mocks (~> 2.1.0)
    rspec-core (2.1.0)
    rspec-expectations (2.1.0)
      diff-lcs (~> 1.1.2)
    rspec-mocks (2.1.0)
    rspec-rails (2.1.0)
      rspec (~> 2.1.0)
    rubyzip (0.9.9)
    sass (3.2.5)
    sass-rails (3.2.6)
      railties (~> 3.2.0)
      sass (>= 3.1.10)
      tilt (~> 1.3)
    selenium-webdriver (2.29.0)
      childprocess (>= 0.2.5)
      multi_json (~> 1.0)
      rubyzip
      websocket (~> 1.0.4)
    sprockets (2.1.3)
      hike (~> 1.2)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    sqlite3 (1.3.5-x86-mingw32)
    thor (0.14.6)
    tilt (1.3.3)
    treetop (1.4.12)
      polyglot
      polyglot (>= 0.3.1)
    tzinfo (0.3.35)
    uglifier (1.2.3)
      execjs (>= 0.3.0)
      multi_json (>= 1.0.2)
    websocket (1.0.7)
    xpath (0.1.4)
      nokogiri (~> 1.3)

PLATFORMS
  x86-mingw32

DEPENDENCIES
  capybara (= 1.1.2)
  coffee-rails (~> 3.2.2)
  jquery-rails (= 2.0.2)
  pg (= 0.12.2)
  rails (= 3.2.1)
  rspec-rails (= 2.1.0)
  sass-rails (~> 3.2.5)
  sqlite3 (= 1.3.5)
  uglifier (= 1.2.3)

1 个答案:

答案 0 :(得分:5)

我认为你的问题是你需要简单地执行以下操作

sudo gem uninstall rspec-core -v 2.2.1
bundle update rspec-core

这可能是其他相关宝石所需要的,例如(rspec-rails,rspec)

通过gem list rspec

进行检查