Derek-MacBook-Pro:example derek$ rails g /Library/Ruby/Gems/1.8/gems/mysql2-0.3.7/lib/mysql2/mysql2.bundle: dlopen(/Library/Ruby/Gems/1.8/gems/mysql2-0.3.7/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError) Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.3.7/lib/mysql2/mysql2.bundle Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql2-0.3.7/lib/mysql2/mysql2.bundle from /Library/Ruby/Gems/1.8/gems/mysql2-0.3.7/lib/mysql2.rb:9 from /Library/Ruby/Gems/1.8/gems/bundler-1.0.11/lib/bundler/runtime.rb:68:in `require' from /Library/Ruby/Gems/1.8/gems/bundler-1.0.11/lib/bundler/runtime.rb:68:in `require' from /Library/Ruby/Gems/1.8/gems/bundler-1.0.11/lib/bundler/runtime.rb:66:in `each' from /Library/Ruby/Gems/1.8/gems/bundler-1.0.11/lib/bundler/runtime.rb:66:in `require' from /Library/Ruby/Gems/1.8/gems/bundler-1.0.11/lib/bundler/runtime.rb:55:in `each' from /Library/Ruby/Gems/1.8/gems/bundler-1.0.11/lib/bundler/runtime.rb:55:in `require' from /Library/Ruby/Gems/1.8/gems/bundler-1.0.11/lib/bundler.rb:120:in `require' from /Users/derek/example/config/application.rb:7 from /Library/Ruby/Gems/1.8/gems/railties-3.0.10/lib/rails/commands.rb:15:in `require' from /Library/Ruby/Gems/1.8/gems/railties-3.0.10/lib/rails/commands.rb:15 from script/rails:6:in `require' from script/rails:6
I have MySQL installed and running in OS X Lion. I have the gem installed. It appears in the gem list (version 0.3.7). What is wrong?
Edit:
Here, I will add my database.yml file. It says the adapter is mysql2 in every environment type. Maybe this will help:
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: example_development
pool: 5
username: root
password:
host: localhost
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: mysql2
encoding: utf8
reconnect: false
database: example_test
pool: 5
username: root
password:
host: localhost
production:
adapter: mysql2
encoding: utf8
reconnect: false
database: example_production
pool: 5
username: root
password:
host: localhost