This message appears under the following situations: You don't have MySQL 5.0.77, you don't have Rails 2.2.2, and you did not build the Gem: mysql-2.7. There are a number of posts on this topic, most of which take you absolutely nowhere. Just do the following (in order, and assuming you are running Mac OS 10.5.x):
- Install MySQL 5.0.77. To check your current version, type: 'mysql --version'
- Switch to your administrator user account using: 'su - Admin' (or whatever the admin account name is)
- Verify that the following line exists in .bash_profile: 'export GEM_HOME="/usr/lib/ruby/gems/1.8"
- Verify that the following lines exist in .gemrc: 'gempath:' and ' - /usr/lib/ruby/gems/1.8'
- Type the following set of commands:
- cd /usr/lib/ruby/gems
- sudo chmod 777 1.8
- cd 1.8
- sudo chmod 777 gems
- sudo chmod 777 cache
- sudo chmod 777 specifications
- sudo chmod 777 doc
- cd ..
- gem install -v=2.2.2 rails
- gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
The chmods are there because in Mac OS, the "Admin" user is different from the "root" user. Because they might have different GEM_HOME environments, it is easier to just make sure the Admin user paths are set properly and execute gem installs as Admin. Trying to enforce gem install paths on the root user is bothersome, to say the least.
If you don't upgrade Rails to 2.2.2, you get an error message when you try to use 'mongrel_rails start'.
If you don't upgrade the mysql gem you get the error in the title of this blog entry
Important note: At this time, 'mongrel_rails start' should work but if 'rake db:create' still shows the error, copy the mysql-2.7 gem directory to /Library/Ruby/Gems/1.8/gems/. This indicates that the Web server is pointing to a different gem directory and I haven't figure out yet how to change that. - cd /usr/lib/ruby/gems