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
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.
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
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.