Mountain Lion - LibXML & Nokogiri

前端 未结 9 1565
一整个雨季
一整个雨季 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:26

    Passing flags to install gems is generally a bad idea if you've got a Gemfile and are using bundler. Even if you're not, you'll be on a custom-compiled libxml and you probably won't remember...! I started by hacking around trying to get this to work and even brew installing libxml2.

    Turns out, if you reinstall (and therefore recompile) the ruby version you're working with (hopefully with rvm), it'll work.

    So, for RVM users:

        rvm list (gets your rubies - choose the one being used)
        rvm uninstall RUBY_VERSION
        rvm install SAME_RUBY_VERSION
        bundle (or gem install nokogiri)
    

    It did the trick for me.

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

    I was having similar issues installing nokogiri gem on ruby 1.9.2 Apparently Apple upgraded gcc... I fixed this with a symlink and then the gem installed just fine:

    sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2

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

    I just had this problem.

    My problem was solved surprisingly easily.

    gem uninstall nokogiri

    Selected all versions

    Then gem install nokogiri and it went away.

    if you are using home-brew, you can brew update and brew doctor. Upgrading to mountain lion even removed my git and stuff. I installed it back by installing cc tools in Xcode and using brew doctor to make sure it's raring to go before the above.

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