Swistak Swistak - 4 years ago 125
SQL Question

RuntimeError with mysql2 and rails3 (bundler)

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.

Answer Source

I had the same error after upgrading from Ubuntu 11.10 to 12.04. This is how I fixed the problem:

gem uninstall mysql2

I think the key here is the 'native extensions' -- I suppose when I installed last, I was using a different version of mysql.

Installing mysql2 (0.3.11) with native extensions
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download