Building a new Rails app and getting a problem with nokogiri. Said to try gem install nokogiri -v \'1.6.8.1\'
which fails with output below. I tried deleting Gemfil
Run this first:
xcode-select --install
Then rerun your bundle install
Reference: https://github.com/sparklemotion/nokogiri/issues/1483
I tried @the_basterd's recommendation. That didn't work, but the reference was good—thank you the_basterd. What worked from that reference was:
brew install libxml2
bundle config build.nokogiri --use-system-libraries --with-xml2-include=/usr/local/opt/libxml2/include/libxml2
Reference: https://github.com/sparklemotion/nokogiri/issues/1483
Later postings at that ref said that what I posted above "is strongly recommended against by the Nokogiri."
brew unlink xz; bundle install; brew link xz
is preferred.
I ran into this issue with nokogiri-1.6.8.1 while using bundle install --path vendor/bundle
to install directly into a project located within a Google Drive sync folder. The hangup seemed related to libxml2.
While reading through the GitHub issue referenced by @Greg and @the_basterd, I noticed that someone was having trouble installing into a Box sync folder. Moving my project folder to another location worked.
Not sure what the underlying problem is when installing to a sync folder, but I'd be interested to learn if anyone had any thoughts.
Haven't tested this with Dropbox, but perhaps that would cause problems, too.
You can also encounter the same error message if you've downloaded XCode Tools but haven't yet agreed to the license.
From Terminal, run:
sudo xcodebuild -license
Enter your admin password, space through the agreement and type agree
to accept. Run brew doctor
and if necessary, brew update
and you should be in good shape.