Home Articles

Bundler找不到gem“nokogiri”的兼容版本

Asked
Viewed 1056 times
2

我将rails应用程序推送到appfog,但收到以下错误消息:

/var/vcap.local/dea/apps/superb-0-dc92a2e492e46c40c06d2abc3ad59841/app/rubygems ruby / 1.9.1 / gems / bundler-1.1.3 / lib / bundler / resolver.rb:129:在`block in resolve 'Bundler找不到兼容版本的gem“nokogiri”:( Bundler :: Versi nConflict)快照(Gemfile.lock):nokogiri(1.5.6)在Gemfile中:capybara(= 1.1.2)ruby依赖于nokogiri(> = 1.3.3)ruby运行捆绑包更新将仅使用Gemfile中的gem从头开始重建快照,这可能会解决冲突 .

和我的Gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.12'
gem 'mysql2'
gem 'pg'
gem 'thin'
gem 'sqlite3'

group :development, :test do
  gem 'rspec-rails', '2.11.0'
end

# Gems used only for assets and not required
# in production environments by default.
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

如何解决问题?

编辑:添加Gemfile.lock

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (3.2.12)
      actionpack (= 3.2.12)
      mail (~> 2.4.4)
    actionpack (3.2.12)
      activemodel (= 3.2.12)
      activesupport (= 3.2.12)
      builder (~> 3.0.0)
      erubis (~> 2.7.0)
      journey (~> 1.0.4)
      rack (~> 1.4.5)
      rack-cache (~> 1.2)
      rack-test (~> 0.6.1)
      sprockets (~> 2.2.1)
    activemodel (3.2.12)
      activesupport (= 3.2.12)
      builder (~> 3.0.0)
    activerecord (3.2.12)
      activemodel (= 3.2.12)
      activesupport (= 3.2.12)
      arel (~> 3.0.2)
      tzinfo (~> 0.3.29)
    activeresource (3.2.12)
      activemodel (= 3.2.12)
      activesupport (= 3.2.12)
    activesupport (3.2.12)
      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.8)
      ffi (~> 1.0, >= 1.0.11)
    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.5.0)
    daemons (1.1.9)
    diff-lcs (1.1.3)
    erubis (2.7.0)
    eventmachine (1.0.1-x86-mingw32)
    execjs (1.4.0)
      multi_json (~> 1.0)
    ffi (1.4.0-x86-mingw32)
    hike (1.2.1)
    i18n (0.6.4)
    journey (1.0.4)
    jquery-rails (2.0.2)
      railties (>= 3.2.0, < 5.0)
      thor (~> 0.14)
    json (1.7.7)
    mail (2.4.4)
      i18n (>= 0.4.0)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    mime-types (1.21)
    multi_json (1.6.1)
    mysql2 (0.3.11-x86-mingw32)
    nokogiri (1.5.6-x86-mingw32)
    pg (0.14.1-x86-mingw32)
    polyglot (0.3.3)
    rack (1.4.5)
    rack-cache (1.2)
      rack (>= 0.4)
    rack-ssl (1.3.3)
      rack
    rack-test (0.6.2)
      rack (>= 1.0)
    rails (3.2.12)
      actionmailer (= 3.2.12)
      actionpack (= 3.2.12)
      activerecord (= 3.2.12)
      activeresource (= 3.2.12)
      activesupport (= 3.2.12)
      bundler (~> 1.0)
      railties (= 3.2.12)
    railties (3.2.12)
      actionpack (= 3.2.12)
      activesupport (= 3.2.12)
      rack-ssl (~> 1.3.2)
      rake (>= 0.8.7)
      rdoc (~> 3.4)
      thor (>= 0.14.6, < 2.0)
    rake (10.0.3)
    rdoc (3.12.2)
      json (~> 1.4)
    rspec (2.11.0)
      rspec-core (~> 2.11.0)
      rspec-expectations (~> 2.11.0)
      rspec-mocks (~> 2.11.0)
    rspec-core (2.11.1)
    rspec-expectations (2.11.3)
      diff-lcs (~> 1.1.3)
    rspec-mocks (2.11.3)
    rspec-rails (2.11.0)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      railties (>= 3.0)
      rspec (~> 2.11.0)
    rubyzip (0.9.9)
    sass (3.2.6)
    sass-rails (3.2.5)
      railties (~> 3.2.0)
      sass (>= 3.1.10)
      tilt (~> 1.3)
    selenium-webdriver (2.30.0)
      childprocess (>= 0.2.5)
      multi_json (~> 1.0)
      rubyzip
      websocket (~> 1.0.4)
    sprockets (2.2.2)
      hike (~> 1.2)
      multi_json (~> 1.0)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    sqlite3 (1.3.7-x86-mingw32)
    thin (1.5.0)
      daemons (>= 1.0.9)
      eventmachine (>= 0.12.6)
      rack (>= 1.0.0)
    thor (0.17.0)
    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)
  mysql2
  pg
  rails (= 3.2.12)
  rspec-rails (= 2.11.0)
  sass-rails (= 3.2.5)
  sqlite3
  thin
  uglifier (= 1.2.3)

3 Answers

  • 3

    你可以试试这个,

    添加你的gemfile

    gem 'nokogiri', '1.3.3'
    

    这样你的应用程序只使用nokogiri 1.3.3而不是最新版本

  • 1

    我有红宝石2.1.3 rails 4.0.2 nokogiri 1.6.6.2

    这对我有帮助

    export NOKOGIRI_USE_SYSTEM_LIBRARIES=true
    
  • 1

    在控制台上执行此命令以更新代码:

    bundle update

    在控制台上发生的各种更新中(我使用的是Mac),您应该看到如下更新: Using nokogiri 1.6.7.2 (was 1.6.6.2) .

Related