blackwinter / ruby-filemagic

Ruby bindings to the magic(4) library, revised.
https://blackwinter.github.iom/ruby-filemagic
146 stars 34 forks source link

just can't be installed on OS X #29

Closed ivanmarchenko83 closed 6 years ago

ivanmarchenko83 commented 6 years ago

installed brew install libmagic but just can't make gem install 'ruby-filemagic' it says ERROR: missing required library to compile this module the first error in the log file says

ld: library not found for -lgnurx clang: error: linker command failed with exit code 1 (use -v to see invocation)

and there no nothing like gnurx for OS X

blackwinter commented 6 years ago

Can you create a Gist of the mkmf.log file so I can take a look at it? Does the discussion in #13 help?

ivanmarchenko83 commented 6 years ago

Finally was able to install it by

env ARCHFLAGS="-arch x86_64" gem install -v 0.7.1 ruby-filemagic -- --with-magic-include=/usr/local/include --with-magic-lib=/usr/local/lib/

please post it in OS X install section - spent a lot of time on this one. Thanks.

cmer commented 2 years ago

On M1/arm Macs:

gem install -v 0.7.2 ruby-filemagic -- --with-magic-include=/opt/homebrew/include --with-magic-lib=/opt/homebrew/lib