Skip to content

Instantly share code, notes, and snippets.

@eparreno
Created February 16, 2012 15:17
Show Gist options
  • Save eparreno/1845561 to your computer and use it in GitHub Desktop.
Save eparreno/1845561 to your computer and use it in GitHub Desktop.
Install libmagic on Mac OS X via homebrew
$ brew install libmagic
$ brew link libmagic (if the link is already created is going to fail, don't worry about that)
$ env ARCHFLAGS="-arch x86_64" gem install ruby-filemagic -- --with-magic-include=/usr/local/include --with-magic-lib=/usr/local/lib/
@kwilczynski
Copy link

If folks that come here have issues with the also excellent ruby-filemagic Ruby Gem, there exists ruby-magic Ruby Gem too, which has a bit more active development.

One can install it as a pre-built (native) Ruby Gem or as usual, in which case it should use bundled libmagic (as an alternative for requiring a system-wide or external one present).

@josefpolach
Copy link

gem install ruby-filemagic -v '0.7.2' --source 'https://rubygems.org/' -- --with-magic-include=/opt/homebrew/include --with-magic-lib=/opt/homebrew/lib/

This worked for me, but did not solved the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment