Yosemite Nokogiri install: libxml2 version 2.6.21 or later is required!


Upgrade to Yosemite lately, but it broke couple ruby nokogiri gem when i need to install it. it show error says below

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/endy/.rbenv/versions/1.9.3-p194/bin/ruby -r ./siteconf20150303-5535-61o6gc.rb extconf.rb

then how to resolve this ?, override system library using brew version. Run this command on terminal

brew install libxml2
ls -l /usr/local/opt/libxml*
lrwxr-xr-x  1 endy  admin  23 Nov 28 03:55 /usr/local/opt/libxml2 -> ../Cellar/libxml2/2.9.2
bundle config build.nokogiri "--use-system-libraries --with-xml2-include=/usr/local/opt/libxml2/include/libxml2"
gem install nokogiri
Building native extensions.  This could take a while...
Successfully installed nokogiri-
Parsing documentation for nokogiri-
Installing ri documentation for nokogiri-
Done installing documentation for nokogiri after 4 seconds
1 gem installed
endy $ gem list nokogiri

*** LOCAL GEMS ***

nokogiri (, 1.6.5,

semoga bermanfaat