ERROR: Error installing mysql: ERROR: Failed to create native gem extension

I followed http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/ "to establish a connection between Ruby on rails app and mysql 5.1 server

Therefore, when I install gem mysql with the following command:

gem install mysql --platform=ruby -- --with-mysql-dir=C:/mysql-connector-c-noinstall-6.0.2-win32 

So, I get the following error log:

Temporarily increasing PATH to enable DevKit ...
Create your own extensions. This may take some time...
ERROR: Error installing mysql:
ERROR: Failed to create native gem extension.

  C:/Ruby187/bin/ruby.exe extconf.rb --with-mysql-dir=C:/mysql-connector-c 

-noinstall-6.0.2-win32 checking for main () in -llibmysql ... no * extconf.rb failed * Failed to create Makefile for some reason, possibly necessary libraries and / or headers. Check the mkmf.log file for more information. Details You may need configuration options.

The configuration options provided are:
--with-OPT-Dir
--without-OPT-Dir
--with non-automatic include
--without-manual enable = $ {blocker dir} / enable
--with non-automatic pb
--without-non-automatic db = $ {non-automatic dir} / lib
--with makeup prog
--without makeup prog
--srcdir =.
--curdir
--ruby = C: / Ruby187 / bin / ruby
--with-MySQL-Dir
--with-mysql-include
--without-mysql-include = $ {mysql-dir} / enable
--with-mysql pb
--without-MySQL-Lib = $ {MySQL-Dir} / Lib
--with-libmysqllib
--without-libmysqllib

Gem files will remain in C: /Ruby187/lib/ruby/gems/1.8/gems/mysql-2.9.1 for verification. Results recorded in C: /Ruby187/lib/ruby/gems/1.8/gems/mysql-2.9.1/ext/mysql_api/ge m_make.out

Additional information: Ruby version 1.8.7 Windows 7 64 bit Mysql 5.1 version

+4
source share
3 answers
  • Download the zip file with the mysql / C connector.

  • Cancel the search in the specified C: drive folder.

  • Copy the zip file with the connector libmySQL.dll from mysql/C

  • try this command gem install mysql --platform=ruby - --with- mysql-lib=C:\mysql-C-connector\lib --with- mysql-include=c:\mysql-C-connector\include

+4
source

Please install Devkit first https://github.com/oneclick/rubyinstaller/wiki/development-kit
http://rubyinstaller.org/downloads/

Follow the instructions from the github repo and it will work fine.

+2
source

It will be easier for you to install rails with railsinstaller .

0
source

Source: https://habr.com/ru/post/1480071/


All Articles