Is:
sudo rake install -- --with-mysql-dir=/usr/local/mysql/
a valid terminal command? I try to run this but it doesn't seem to pass in the variable correctly..
However something like this works fine:
sudo gem install do_mysql -- --with-mysql-dir=/usr/local/mysql/