RuntimeError: !!! Missing the mysql2 gem
I started migrating my blog from Rails 2 to Rails 3, working up my deployment setup using rvm and phusion passenger. When setting up the staging server, I run into this error:
RuntimeError: !!! Missing the mysql2 gem. Add it to your Gemfile: gem 'mysql2'
mysql2
gem was already in the Gemfile. After looking around, I found out that I had wrong database adapter because, of course, I have copied the old database.yml from Rails 2 application where is was:
production:
adapter: mysql
encoding: utf8
reconnect: false
database: blog
pool: 5
username: root
password:
socket: /var/run/mysqld/mysqld.sock
The solution is just to change the adapter from mysql
to mysql2
:
production:
adapter: mysql2
encoding: utf8
reconnect: false
database: blog
pool: 5
username: root
password:
socket: /var/run/mysqld/mysqld.sock