I tried to install composer via brew per:
In usr/local/bin (which was not on Mavricks and I had to make personally) I did.
usr/local/bin
brew tap jose
I encountered the same error, and was able to solve it as follows:
composer diagnose
composer self-update
composer update
composer.json