Homebrew で groonga をインストールしている前提のお話。
and GROONGA_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
とか出てたら、GROONGA_CFLAGS と GROONGA_LIBS を指定してあげる。
GROONGA_CFLAGS="-I/usr/local/include/groonga" \
GROONGA_LIBS="-L/usr/local/lib -lgroonga" \
brew install https://raw.github.com/mroonga/homebrew/master/mroonga.rb --use-homebrew-mysql