I suggest you first uninstall Nokogiri using:
sudo gem uninstall nokogiri
Then install Nokogiri using rubygems:
gem install nokogiri
If that doesn't work, there's an open issue on Nokogiri to support libxml 2.9.0 and later. There's a libxml2-2.9.1 branch that was started in preparation for the next release of libxml2.
Then try pulling from that branch in your Gemfile like this:
gem "nokogiri", github: "sparklemotion/nokogiri", branch: "libxml2-2.9.1"
or install an older version of libxml2.
If that still doesn't work you may also want to try the suggestions here: What to do if libxml2 is being a jerk.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…