gem install nokogiri -v '1.6.8.1' fails

99封情书 提交于 2019-12-02 20:29:47
the_basterd

Run this first:

xcode-select --install

Then rerun your bundle install

Reference: https://github.com/sparklemotion/nokogiri/issues/1483

Greg

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.

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!