Skip to content

Instantly share code, notes, and snippets.

@ivyleavedtoadflax
Last active September 11, 2017 12:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivyleavedtoadflax/0eb8eb503d733fde41ec1a4fd409da25 to your computer and use it in GitHub Desktop.
Save ivyleavedtoadflax/0eb8eb503d733fde41ec1a4fd409da25 to your computer and use it in GitHub Desktop.
What to do when installing R package xml2 fails on OS X El Capitan
  • Download the latest binary of the xml2 package from here: https://cran.r-project.org/web/packages/xml2/index.html, you want: OS X El Capitan binaries: r-release: xml2_1.1.1.tgz (or similar).
  • Extract to a local dir with tar -xvf xml2_1.1.1.tgz.
  • Find where libxml2 is installed (or install with brew install libxml2), mine is /usr/local/Cellar/libxml2/2.9.4_3.
  • Set environment variable export LIBXML_INCDIR=/usr/local/Cellar/libxml2/2.9.5 using the path from above.
  • Install to the appropriate library: R CMD INSTALL -l ~/Documents/OMSQ_RAP/packrat/lib/x86_64-apple-darwin15.6.0/3.4.1/ .. Note that this installs into a packrat library, if you just want a system install do: R CMD INSTALL .

et voila!

UPDATE: This works for installing xml2, but it doesn't seem to work as a dependency for other packages that require it.

sources:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment