Mar 20 2010

Ruby on Rails, MAMP, MySQL, and OS X 10.6

Web Development View comments

I spent a very long time trying to get Ruby on Rails working with MAMP's MySQL on OS X 10.6. I was always getting this error message:

$ rake db:migrate
rake aborted!
uninitialized constant MysqlCompat::MysqlRes

To eliminate the above error, my solution to the problem was simply:

$ cd /usr/local/bin
$ sudo mv ruby ruby.bak
$ sudo ln -s /usr/bin/ruby ruby

Now, to tell your application to use MAMP's MySQL server, just add the socket parameter to your database.yml file, as demonstrated here.

I hope that helps.