Problem with Mysql connector in rails

0

I am not able to create a database for my Rails application it says the following message:

Error

  

C: \ Ruby21-x64 \ DevKit \ Project> rake db: create DL is deprecated, please   use Fiddle rake aborted! LoadError: Please install the mysql2 adapter:    gem install activerecord-mysql2-adapter (can not activate mysql2 (~>   0.3.10), already activated mysql2-0.4.3-x64-mingw32. Make sure all dependencies are added to Gemfile.)

     

Gem :: LoadError: can not activate mysql2 (~> 0.3.10), already activated   mysql2-0.4.3-x64-mingw32. Make sure all dependencies are added to   Gemfile.

     

Tasks: TOP = > db: create (See full trace by running task with --trace)

I do not know why it started msql2 in version 0.3.10 and this causes the database to not be created. Any tips?

[ UPDATE )

When I tell him to create the project he shows me this:

  

You have installed the binary version of mysql2. It was built using   MySQL Connector / C version 6.1.6. It is recommended to use the exact   same version to avoid potential issues.

     

At the time of building this gem, the necessary DLL files were   retrieved from:    link

     

This gem includes vendor / libmysql.dll with redistribution notice in   vendor / README.

    
asked by anonymous 01.04.2016 / 01:18

1 answer

0

The problem is not in ruby, it is not finding it's windows DLLs to connect with mysql.

Download the file that says the error:

http://cdn.mysql.com/Downloads/Connector-C/mysql-connector-c-6.1.6-win32.zip

Then extract to the folder C: \ mysql-connector

Then run the terminal:

gem install mysql2 --platform=ruby -- '--with-mysql-dir="C:\mysql-connector"'

And see if it installs.

    
01.04.2016 / 04:54