This is usually a brew install libmagic
I need this because ruby-filemagic 'Ruby Gem needs it.
Try brew install magic
brew install magic
If you do not have the libmagic.1.dylib file on your system, you need to install it using the port command
sudo port install file