Please install the mysql2 adapter: ‘gem install activerecord-mysql2-adapter’

I am a beginner of ruby on rails. Unfortunately rails 3.0 seems to have many changes in its command line, so most of the tutorials I am reading are not updated.

Today I was trying to use mysql into my application, so I did

$ gem install mysql2

Unfortunately i get

Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (no such file to load -- active_record/connection_adapters/mysql2_adapter)

In rails 3, a new bundle manager is being used, therefore we need to add the vim declaration in [application root]/Gemfile

Edit the Gemfile and add the following

$ gem 'mysql2','<0.3'

Save. If ‘bundle’ is not yet installed, do a

$ gem install bundle

first. Then update your bundles

bundle install

It should fix this issue.

If you want to learn more about “bundle” go to http://gembundler.com/

Though English is my country's official language it is not my native tongue. If you find anything wrong with my phrases, or any incorrect information, write it out loud in the comments section. The world will be a bit better that way.
Posted in Javascript

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre user="" computer="" escaped="">