2013-02-20 83 views
2

我推一个Rails应用程序到appfog,但得到了以下错误消息:捆扎机找不到兼容版本的宝石“引入nokogiri”

/var/vcap.local/dea/apps/superb-0-dc92a2e492e46c40c06d2abc3ad59841/app/ruby​​gems ruby​​/1.9.1/gems/bundler-1.1.3/lib/bundler/resolver.rb:129:在'block in resolve'Bundler找不到兼容版本的宝石 “nokogiri”:(Bundler :: Versi nConflict)在快照(Gemfile.lock)中: nokogiri(1.5.6)在Gemfile中: capybara(= 1.1.2)ruby取决于 nokogiri(> = 1.3.3)ruby

运行bundle update将从零开始重建您的快照,仅使用您的Gemfile中的 宝石,这可能会解决冲突。

和我的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) 
+1

你有没有试过'''包更新'''? – Bob 2013-02-20 07:34:40

+0

是的,我试过了,但没有奏效。 – 2013-02-20 14:50:05

+0

你能手动删除gemfile.lock吗? – 2013-02-21 00:47:58

回答

3

你可以试试这个,

添加在您的Gemfile

gem 'nokogiri', '1.3.3' 

,使您的应用程序使用引入nokogiri 1.3.3改为只最新版本

+0

解决后,添加:gem'nokogiri','1.3.3'和gem'ffi','1.0.11',但为什么“捆绑更新”不更新Gem到最佳版本? – 2013-03-01 04:15:22

+1

软件包更新不会将gem更新为最佳版本,它会更新为Gemfile中提及的版本或可用的最新版本(如果Gemfile中未提及)。 – 2013-03-01 09:11:53

+0

谢谢,也许他们可以开发一个新的选项:捆绑最佳更新:) – 2013-03-01 10:10:56

1

我有ruby 2.1.3 rails 4.0.2 nokogiri 1.6.6.2

这有助于我

export NOKOGIRI_USE_SYSTEM_LIBRARIES=true 
+1

如果你在MAC上,而你刚升级到优胜美地;有很多事情要做:1)brew install libxml2 libxslt 2)brew链接libxml2 libxslt;然后做这个。 – FlyingV 2016-11-17 02:08:42

1

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

bundle update

并在控制台上出现的各种更新中(我使用的是Mac),你应该看到像这样的更新:Using nokogiri 1.6.7.2 (was 1.6.6.2)

相关问题