luislavena / mysql-gem

MySQL/Ruby Bindings, wrapped as Gem with improved cross-platform support
http://rubyforge.org/projects/mysql-win
Other
53 stars 20 forks source link

Not able to install mysql gem in ruby 2.3.3 #34

Closed LellaKS closed 3 years ago

LellaKS commented 7 years ago

Not able to install mysql gem in ruby 2.3.3. My ruby version : ruby 2.3.3p222 (2016-11-21 revision 56859) [x64-mingw32]. Getting belo exception while installing mysql gem. C:\Ruby23-x64>gem install mysql Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension.

current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mysql-2.9.1/ext/mysql_api

C:/Ruby23-x64/bin/ruby.exe -r ./siteconf20170123-7004-xoua5t.rb extconf.rb checking for main() in -llibmysql... no extconf.rb failed Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=C:/Ruby23-x64/bin/$(RUBY_BASE_NAME) --with-mysql-dir --without-mysql-dir --with-mysql-include --without-mysql-include=${mysql-dir}/include --with-mysql-lib --without-mysql-lib=${mysql-dir}/lib --with-libmysqllib --without-libmysqllib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/mysql-2.9.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mysql-2.9.1 for inspection. Results logged to C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/mysql-2.9.1/gem_make.out Attaching gem_make.out and mkmf.log files. gem_makeout.txt mkmflog.txt My ruby Dev kit version : DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe Would please help me to resolve the issue?

abdulbasit1248 commented 3 years ago

Same issue. Any help would be appreciated.

luislavena commented 3 years ago

Hello @LellaKS and @abdulbasit1248 , error message indicate that is missing a dependency necessary to compile the gem:

checking for main() in -llibmysql... no
*** extconf.rb failed ***

You will need to install the necessary MySQL client library in order for it to compile.

For Ruby 2.3, you can see at some instructions I published long ago:

http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/

Hope that helps.

Cheers.