How to install Gearman on OS X

Setup Gearman job server with OS X 10.9.2 Mavericks using brew.

brew install gearman

If you get an error during the build:

==> make install
#  include <tr1/cinttypes>
           ^
1 error generated.
make[1]: *** [libgearman/libgearman_libgearman_la-check.lo] Error 1
make: *** [install] Error 2
Error: Homebrew doesn’t know what compiler versions ship with your version
of Xcode (5.1.1). Please `brew update` and if that doesn’t help, file
an issue with the output of `brew —config`:
  https://github.com/mxcl/homebrew/issues
[...]

Then you can run this command to possibly fix it:

xcode-select —install
brew update
brew install gearman

And lastly some useful install notes copied from the end of the script worth noting:

Start gearman at boot time:

ln -sfv /usr/local/opt/gearman/*.plist ~/Library/LaunchAgents

Start gearman now:

launchctl load ~/Library/LaunchAgents/homebrew.mxcl.gearman.plist

Raw start:

gearmand -d
Apr 23, 2014 Servers