Nokogiri install on MacOSX

Getting nokogiri to install was failing for me. I'm using bundler and needed nokogiri. Gem is trying to compile it and failing on libxml2.

At first I tried using the libxml from brew, that that didn't work, so specified where to find XCode's version of libxml in my bundle config.

~/.bundle/config
BUNDLE_BUILD__NOKOGIRI: "--use-system-libraries=true --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libxml2"

You might need to tweak the MacOSX10.14.sdk part, that's for Mojave, I've been using this line for a while, and just updated from 10.12->10.13->10.14.

I also like to install the gems in my home directory, so I add the following to my bundle config:
BUNDLE_PATH: "/Users/thomas/.gem"

Add new comment

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.

About the Author...

Slides from LISA 2019 Linux systems troubleshooting #LISA2019 https://t.co/D4dMKflK6R Tue Oct 29 05:59:30 +0000 2019

https://t.co/AGeihMALAv configuring grub2 with EFI Fri Sep 13 05:20:01 +0000 2019

I published a Thing on @thingiverse! https://t.co/IYpRyEb7Hz #thingalert Tue Jul 23 19:27:57 +0000 2019

Nokogiri install on MacOSX https://t.co/v3An0miW9L Fri Jul 12 15:06:49 +0000 2019

HTML email with plain mailer plugin on Jenkins https://t.co/Z6FSDMDjy8 Thu Jul 11 21:07:25 +0000 2019