Question:

I am running a rails3 app on Dreamhost: not the best call but I need it operational before I can pitch migrating to Heroku.

I am using rails 3.2.1, and ruby 1.8.7 with

gem ‘mysql2’, ‘~> 0.2.7’

in my Gemfile…

I get the following error when I deploy and reload:

Please install the mysql adapter: gem install activerecord-mysql-adapter (mysql is not part of the bundle. Add it to Gemfile.)

I have tried gem ‘mysql2’, gem ‘mysql2’, ‘< 0.3’ and get the exact same issue.

Any other ideas?

Answer:

In general when rails is trying to be helpful it will try to generate the name of an adapter gem based on whatever you have in your database.yml. If that gem doesn’t exist it’s a good indication that something with the adapter line is wrong

for mysql2 the adapter type needs to be mysql2 as well

database.yml

adapter: mysql2

via StackOverFlow

If you’re coding a little too fast, it’s easy to miss the simple things.