Trying to install Nokogiri I’m getting the following error
Maxims-MacBook-Air:ScrapingTheApple maximveksler$ gem install nokogiri
Fetching: nokogiri-1.6.2.1.
In my case I had upgraded Xcode and forgot to install the command line tools so install was not able to run compiler.
The following installs the command line tools:
xcode-select --install
I was successfull with:
gem install nokogiri -- \
--with-iconv-lib=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib \
--with-iconv-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include
I was experiencing this problem as well, turns out for me it was a result of having installed macports under Mavericks, and not having migrating the setup to Yosemite.
Following the instructions here:
http://trac.macports.org/wiki/Migration
Allowed me to install the older version of Nokogiri (1.5.x) that was a dependency of rspec-puppet
The nokogiri install tutorial provides the solution:
# bash
brew unlink gcc
gem uninstall nokogiri
xcode-select --install
gem install nokogiri
If you don't have Xcode 6.1, yet, you may install it from the apple developer download site (section additional tools), as described in this blog post.