Issues with gem Rdmtx

守給你的承諾、 提交于 2020-01-05 05:36:08

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/43860050/issues-with-gem-rdmtx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!