Mountain Lion - LibXML & Nokogiri

前端 未结 9 1564
一整个雨季
一整个雨季 2020-12-24 12:34

I\'ve just updated to OS X Mountain Lion and I\'m getting the following when working with rails and terminal.

WARNING: Nokogiri was built against LibXML vers         


        
相关标签:
9条回答
  • 2020-12-24 13:13

    Putting gem 'nokogiri' above gem 'pg' in my Gemfile fixed this for me.

    My Gemfile didn't have nokogiri in it, but it was a dependency that was in Gemfile.lock, so I put it in my Gemfile explicitly.

    0 讨论(0)
  • 2020-12-24 13:15

    Nothing seemed to work for me to fix this one.

    Then I went into xcode and installed the updated command line tools, then gem uninstall nokogiri and gem install nokogiri and it worked!

    0 讨论(0)
  • 2020-12-24 13:16

    Using Ruby 1.9.3-p194 and Rails 3.2.11 on OS X 10.8.2 (Mountain Lion), starting rails c gave the warning:

    WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.8
    

    The uninstall/install nokogiri trick didn't work for me. The solution was much simpler... The warning was avoided completely by editing the Gemifile to place 'nokogiri' above 'pg'.

    References:

    • https://github.com/sparklemotion/nokogiri/issues/742
    • http://www.alanmaciel.net/?p=104
    0 讨论(0)
  • 2020-12-24 13:17

    After upgrading ruby-build

    brew update
    brew upgrade ruby-build
    

    I just reinstalled ruby (last version)

    rbenv install 1.9.3-p194
    

    and then I installed all the gems related to my project including nokogiri without having further problems.

    gem install bundler
    bundle
    
    0 讨论(0)
  • 2020-12-24 13:18

    So I ended up using the following command:

    bundle config build.nokogiri --with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.7.8/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26/
    

    And then doing:

    gem uninstall nokogiri
    gem install nokogiri
    

    And then ran

    bundle install
    
    0 讨论(0)
  • 2020-12-24 13:23

    all the solution listed so far in here didn't work for me.

    So, I did a brew uninstall libxml2 it was the version libxml2 2.8.0 and i guess my os x has libxml2 version 2.7.8 pre-installed

    then i did gem uninstall nokogiri and then gem install nokogiri

    Warning is gone now. But it's libxml2 version 2.7.8 and not the latest. So, I appreciate, if you suggest some solution that work with latest version of libxml2.

    0 讨论(0)
提交回复
热议问题