5

我将 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:in `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) 红宝石

运行bundle update将只使用 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)
4

3 回答 3

4

你可以试试这个

添加你的gemfile

gem 'nokogiri', '1.3.3'

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

于 2013-02-28T09:50:43.427 回答
2

我有 ruby​​ 2.1.3 rails 4.0.2 nokogiri 1.6.6.2

这对我有帮助

export NOKOGIRI_USE_SYSTEM_LIBRARIES=true
于 2015-02-05T08:38:52.703 回答
1

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

bundle update

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

于 2016-04-11T03:28:48.673 回答