I\'m having the exact issue as described in this question: MYSQL Installation Troubles. Unfortunately none of the answers helped me (and it\'s closed).
I try to learn
for some reason (maybe because i'm using rubygems 1.3.7 or installing mysql-2.8.1)
sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
did not work for me so after taking a look at gems/mysql-2.8.1/ext/mysql_api/extconf.rb i found out that the extconf.rb looks in the PATH for mysql_config so i tried
export PATH=$PATH:/usr/local/mysql/bin
sudo gem install mysql
and did the job