RuntimeError with mysql2 and rails3 (bundler)

Solution 1:

I was getting the same error while using rails 3.0.7 and mysql2 0.3.2. The solution, which I found here, is to use an older version of mysql2. Thus edit your gemfile to

gem 'mysql2', '< 0.3'

and run

bundle install 

Solution 2:

Also need to change adapter from mysql to mysql2 in database.yml as said here Install mysql2 gem on Snow Leopard for Rails 3 with rvm

From:

development: adapter: mysql

To:

development: adapter: mysql2