For anyone doing stuff requiring a good MIME library in Ruby, shared-mime-info works well. On OS X a few things are necessary to make it work though.
First, use ports to install the shared-mime-info database:
sudo port install shared-mime-info
Then you have to set XDG_DATA_DIRS to point at the right…

