DEV Community

OKURA Masafumi
OKURA Masafumi

Posted on

Installing libxml-ruby on macOS

I always cannot find the way to install libxml-ruby gem which is used by Rails, so here's a command:

gem i libxml-ruby -- --with-xml2-dir=`brew --prefix libxml2` --with-xml2-config=`brew --prefix libxml2`/bin/xml2-config
Enter fullscreen mode Exit fullscreen mode

Top comments (2)

Collapse
 
harry_wood profile image
Harry Wood

This assumes you've installed libxml using homebrew.

I've encountered this and many other tips while googling around today. I've tried to compile them into a logical order of some things to try: Installing/debugging libxml on mac for ruby/rails.

Personally I found I didn't need the homebrew libxml. Some version compatibility there which meant building against my older system libxml worked better. But over the years there seems to be a lot different problems and a lot of "This simple fix worked for me" solutions put out there.

Collapse
 
jorgeddw profile image
Jorge Dominguez

Neat!