When attempting to install/upgrade to, at time of writing, the current Gearman version with homebrew you will encounter this error:
libgearman-server/plugins/queue/mysql/queue.cc:49:10: fatal error: 'mysql/mysql.h' file not found #include <mysql/mysql.h>
Thanks to this bug report: 13392 it appears to be caused by missing headers. Further investigation shows that the Gearman make expects the headers to be in "/usr/local/include/mysql/" however the headers are install by homebrew into "/usr/local/include".
The bug report above (13392) suggests disabling MySQL support much like mac ports has, but what if you want MySQL support or don't want to hack around this issue?
$ cd /usr/local/lib/mysql $ ln -s ../mysql.h $ ln -s ../mysql_com.h $ ln -s ../mysql_embed.h $ ln -s ../mysql_time.h $ ln -s ../mysql_version.h $ ln -s ../mysqld_ername.h $ ln -s ../mysqld_error.h
You will now be able to install/upgrade Gearman with no issues.