0

I spent most of the day yesterday searching for a clear answer for installing ruby-augeas. I can't find a good solution.

How do I install it?

The error while installing:

gem install ruby-augeas
    Building native extensions. This could take a while...
    ERROR:  Error installing ruby-augeas:
        ERROR: Failed to build gem native extension.

        current directory: /Users/vmware/.rvm/gems/ruby-2.4.4/gems/ruby-augeas-0.5.0/ext/augeas
    /Users/vmware/.rvm/rubies/ruby-2.4.4/bin/ruby -I /Users/vmware/.rvm/rubies/ruby-2.4.4/lib/ruby/site_ruby/2.4.0 -r ./siteconf20190923-73327-iy4kfy.rb extconf.rb
    creating Makefile

    current directory: /Users/vmware/.rvm/gems/ruby-2.4.4/gems/ruby-augeas-0.5.0/ext/augeas
    make "DESTDIR=" clean

    current directory: /Users/vmware/.rvm/gems/ruby-2.4.4/gems/ruby-augeas-0.5.0/ext/augeas
    make "DESTDIR="
    compiling _augeas.c
    In file included from _augeas.c:25:
    /usr/local/Cellar/augeas/1.12.0/include/augeas.h:24:10: fatal error: 'libxml/tree.h' file not found
    #include <libxml/tree.h>
             ^~~~~~~~~~~~~~~
    1 error generated.
    make: *** [_augeas.o] Error 1

    make failed, exit code 2

    Gem files will remain installed in /Users/vmware/.rvm/gems/ruby-2.4.4/gems/ruby-augeas-0.5.0 for inspection.
    Results logged to /Users/vmware/.rvm/gems/ruby-2.4.4/extensions/x86_64-darwin-18/2.4.0/ruby-augeas-0.5.0/gem_make.out

I have also installed brew install augeas pkg-config, but it shows same error.

Gagan
  • 573
  • 8
  • 25

1 Answers1

0

Finally, I have solved this issue.

export PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig"

This is all you need. The configure script will run pkg-config to find out what to add to LDFLAGS and CPPFLAGS.

source: https://github.com/remacs/remacs/issues/886

Gagan
  • 573
  • 8
  • 25