cannot load such file -- mysql/mysql_api

Viewed 7950

I am completing the tutorial on Ruby on Rails 3 Essential Training through Lynda.com on Windows 7, and I am in the section on "Databases and Migrations". I am attempting to sync the database I have created in MySQL with my Rails project, however I have been running into an abort message. The instructor asked my class to go through Command Prompt to open up our rails project and perform a Rake to build a "schema.rb" with this code:

rake db:schema:dump

Yet each time I type the code in I have gotten this error message:

C:\Users\User\Documents\simple_cms>rake db:schema:dump

rake aborted!

cannot load such file -- mysql/mysql_api

C:/Users/User/Documents/simple_cms/config/application.rb:7:in `<top (required)>'

C:/Users/User/Documents/simple_cms/Rakefile:4:in `<top (required)>'

(See full trace by running task with --trace)

Some solutions I have attempted:

  1. I have installed the binary version of mysql. It was built using MySQL Connector/C version 6.0.2. and I added

    libmySQL.dll

to

C:\RailsInstaller\Ruby1.9.3\bin

from dev.mysql.com

  1. I have attempted to download the "mysql2" Gem through Command Prompt with the following result:

    C:\Users\User\Documents\simple_cms>gem install mysql2
    
    Temporarily enhancing PATH to include DevKit...
    
    Building native extensions.  This could take a while..
    
    ERROR:  Error installing mysql2:
    
    ERROR: Failed to build gem native extension.
    

Help?

2 Answers
Related