small medium large xlarge

19 Aug 2012, 03:07
Steve Zhang (22 posts)

In page 235, when I run the following command :

rake db:setup RAILS_ENV=”production”

I got following error:

rake aborted! Please install the msql2 adapter: gem install activerecord-msql2-adapter (cannot load such file – active_record/connection_adapters/msql2_adapter)

Tasks: TOP => db:setup => db:schema:load_if_ruby => db:create (See full trace by running task with –trace)

When I try to run the following command to install the msql2 adapter: gem install activerecord-msql2-adapter

I got the error: ERROR: Could not find a valid gem ‘activerecord-msql2-adapter’ (>= 0) in any repository ERROR: Possible alternatives: activerecord-mysql2-adapter, activerecord-nulldb-adapter, activerecord-fb-adapter, activerecord-odbc-adapter, activerecord-jdbch2-adapter

My environment is Mac Lion, ruby 1.9.4, rails 3.2.8

Can anybody provide some insight for this issue?


20 Aug 2012, 03:05
Steve Zhang (22 posts)

I figured out that in the config/database.yml, I typed “msql2” instead of “mysql2”. After I changed to “mysql2”, this issue did not existed anymore.

You must be logged in to comment