blackwinter / ruby-filemagic

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

bundle install is broken when this gem is listed #19

Closed chris1248 closed 8 years ago

chris1248 commented 8 years ago

I listed this gem in my Gemfile and tried bundle install.

It broke telling me that extconf.rb failed with some missing header or library.

It failed with:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
    /Users/cjohnson/.rbenv/versions/2.1.5/bin/ruby extconf.rb
   checking for main() in -lgnurx... no
  checking for magic_open() in -lmagic... no
  *** ERROR: missing required library to compile this module
  *** extconf.rb failed ***
  Could not create Makefile due to some reason, probably lack of necessary
  libraries and/or headers.  Check the mkmf.log file for more details.  You may
  need configuration options.
blackwinter commented 8 years ago

You need to install the header files first; see README. On OS X you can brew install libmagic and reinstall the gem.