cannot install mysql2 gem

Gabriel Ferreira's Avatar

Gabriel Ferreira

29 Nov, 2013 03:53 PM

Hi. I'm trying to install mysql2 gem on my windows 7 computer. But when i do gem install mysql2 '0.3.14', i got an error, and i can't understand what is happening. Can someone help me please? I'm tryint to finish my "Redmine" install like forever, but it seems that it is impossible.
PS: i installed another version of mysql2 gem, and it worked just fine. but i'm using bundler to install all gems required to my "Redmine" installation, and it requires to install the latest version.

ERROR:

c:\webserver\Redmine>gem install mysql2 -v '0.3.14'
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.

    C:/webserver/Ruby/bin/ruby.exe extconf.rb

checking for ruby/thread.h... no
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... 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:/webserver/Ruby/bin/ruby --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-mysql-config --without-mysql-config --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-mysqlclientlib --without-mysqlclientlib --with-mlib --without-mlib --with-mysqlclientlib --without-mysqlclientlib --with-zlib --without-zlib --with-mysqlclientlib --without-mysqlclientlib --with-socketlib --without-socketlib --with-mysqlclientlib --without-mysqlclientlib --with-nsllib --without-nsllib --with-mysqlclientlib --without-mysqlclientlib --with-mygcclib --without-mygcclib --with-mysqlclientlib --without-mysqlclientlib

Gem files will remain installed in C:/webserver/Ruby/lib/ruby/gems/1.9.1/gems/my
sql2-0.3.14 for inspection.
Results logged to C:/webserver/Ruby/lib/ruby/gems/1.9.1/gems/mysql2-0.3.14/ext/m
ysql2/gem_make.out

  1. Support Staff 2 Posted by Luis Lavena on 29 Nov, 2013 04:56 PM

    Luis Lavena's Avatar

    You need mysql headers and libraries to properly compile the gem.

    Please see the following post about compilation of mysql (or mysql2) gems:

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

    Sorry for top posting. Sent from mobile.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac