I get this error
`establish_connection': Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (no such file to load -- active_record/connection_adapters/mysql2_adapter) (RuntimeError)
from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-
Here is dump of whole error and my config and gemfile.
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
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
Did you include the mysql2 gem in your gemfile instead of the old mysql gem, and ran bundle install afterwards?
If you're using rvm, and possibly added mysql2 outside of rvm, try these steps: Confirm that your Gemfile says:
gem 'mysql2'
or for Rails2.x:
gem 'mysql2', '~> 0.2.11'
then:
$ cd RAILS_ROOT
$ gem uninstall mysql2
Select gem to uninstall:
1. mysql2-0.2.11
2. mysql2-0.3.6
3. All versions
> 3 # select "All versions"
$ rvm gemset install mysql2
$ bundle install
Now rails should start properly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With