Can't 'rake db:migrate' keep getting dlopen mysql.bundle error

MySQL version: 5.5.10 Ruby version: 1.8.7 Rails version: 3.0.5

I'm trying to get a Mac OS X 10.6.6. development box up and going, and I'm having problems with 'rake db:migrate.'

This is how I installed the mysql gem

$ sudo env ARCHFLAGS="-arch x86_64" gem install --no-rdoc --no-ri mysql --version 2.7 -- --with-mysql-dir=/usr/local/mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config Fetching: mysql-2.7.gem (100%) Building native extensions. This could take a while... Successfully installed mysql-2.7 1 gem installed

Then, when I run rake db:migrate I get this:

!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql. rake aborted! dlopen(/Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle, 9): Library not loaded: libmysqlclient.18.dylib   Referenced from: /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle   Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle

I've been Googling for hours, and all the solutions I'm being presented with are not working. I've tried running this:

sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib mysql.bundle

And that did not work. Or maybe I'm not using it right. Can someone please point me in the right direction or help me come up with another solution? I've been trying to get my development environment going for almost a week now and am about to go NUTS (lmao!).

Anyhow ... any help is much appreciated.

Thank you for your time!

- Dustin

!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql. rake aborted! dlopen(/Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle, 9): Library not loaded: libmysqlclient.18.dylib Referenced from: /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle

I've been Googling for hours, and all the solutions I'm being presented with are not working. I've tried running this:

sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib mysql.bundle

And that did not work. Or maybe I'm not using it right. Can someone please point me in the right direction or help me come up with another solution? I've been trying to get my development environment going for almost a week now and am about to go NUTS (lmao!).

Worth checking that everything is compiled for the same architecture (mysql.bundle, libmysqlclient etc.) and that there aren't any weird permissions things stopping ruby from reading the file.

Fred