betogrun
betogrun

Reputation: 93

Issues with gem Rdmtx

I'm facing the issue bellow when I try to install the Rdmtx gem:

$ gem install Rdmtx
Building native extensions.  This could take a while...
ERROR:  Error installing Rdmtx:
    ERROR: Failed to build gem native extension.

    /Users/alberto/.rbenv/versions/2.2.5/bin/ruby -r ./siteconf20170508-97735-7c5328.rb extconf.rb
checking for main() in -ldmtx... no
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling Rdmtx.c
Rdmtx.c:26:10: fatal error: 'dmtx.h' file not found
#include <dmtx.h>
         ^
1 error generated.
make: *** [Rdmtx.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/alberto/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/Rdmtx-0.3.1 for inspection.
Results logged to /Users/alberto/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-16/2.2.0-static/Rdmtx-0.3.1/gem_make.out

I have already installed libdmtx via brew but the issue remais.

Can someone help me?

Upvotes: 1

Views: 551

Answers (1)

Kathryn
Kathryn

Reputation: 1607

I can reproduce the error before installing libdtmx, but afterward the gem installed as expected. Either the library didn't install the header file or the gem install process didn't look in the right place. To check for the first, see if you can find the header somewhere in /usr:

$ find /usr -name dmtx.h
/usr/local/Cellar/libdmtx/0.7.4/include/dmtx.h
/usr/local/include/dmtx.h

You can try running brew doctor to see if there are any problems. If that turns up nothing, make sure when you run brew config, you see a line that looks like:

HOMEBREW_PREFIX: /usr/local

If the file is installed in /usr/local/include the gem installation must not be looking there. Not sure what to do in that case, however.

Upvotes: 1

Related Questions