Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot load such file -- mysql2/2.4/mysql2 (LoadError)` #861

Closed
araufit opened this issue Jun 24, 2017 · 23 comments
Closed

cannot load such file -- mysql2/2.4/mysql2 (LoadError)` #861

araufit opened this issue Jun 24, 2017 · 23 comments
Milestone

Comments

@araufit
Copy link

araufit commented Jun 24, 2017

I am new on Ruby on Rails. My Ruby version is ruby2.4.1p111 (2017-03-22 revision 58053) [x64-mingw32].

I have created a new project using rails new sample_cms -d mysql command.

The command rails server is throwing following error.

C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mysql2-0.4.6-x64-mingw32/lib/mysql2/mysql2.rb:2:inrequire': cannot load such file -- mysql2/2.4/mysql2 (LoadError)`
I have installed mysql and mysql Connector C. I have installed the mysql2 gem like that.

gem install mysql2 —platform=ruby — ‘—with-mysql-dir="C:\Program Files\MySQL\MySQL Connector C 6.1"’
I have uninstall and install the mysql2 gem but still facing the issue. Here is the directory which may have issue.

27505154-7b8f3f4e-58b2-11e7-8c8a-66980553443c

Here is the gem file entry for mysql2

Bundle edge Rails instead: gem 'rails', github: 'rails/rails'

gem 'rails', '~> 5.1.1'

Use mysql as the database for Active Record

gem 'mysql2', '>= 0.3.18', '< 0.5'

Use Puma as the app server

gem 'puma', '~> 3.7'
Any Help?

@sodabrew
Copy link
Collaborator

sodabrew commented Jun 24, 2017

There is no mysql2 binary for Ruby 2.4 for Windows available at this time. You could compile it on your own at this time. At some point in the future I will have this in the public packages, but that will not happen on any immediate schedule.

@araufit
Copy link
Author

araufit commented Jun 24, 2017

@sodabrew .. How can i compile it. Can you please guide me to any tutorial or procedure?

@wjh94
Copy link

wjh94 commented Jun 25, 2017

I'm also having problem in using mysql2 gem in Ruby 2.4. The binary is not listed inside the gem directory, and googling takes me here. I have tried downloading the source code, building the gem by using **gem build** _mysql2.gemspec_, then install it by providing the mysql connector location -since that I'm using 32-bit version of Ruby inside 64-bit Windows-, and then I got this error. Any idea on how to compile it properly?

E:\mysql2-0.4.6>gem install .\mysql2-0.4.6.gem --platform ruby -- '--with-mysql-dir="C:/Program Files (x86)/MySQL/MySQL Connector C 6.1"'
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions with: '--with-mysql-dir="C:/Program Files (x86)/MySQL/MySQL Connector C 6.1"'
This could take a while...
ERROR:  Error installing .\mysql2-0.4.6.gem:
        ERROR: Failed to build gem native extension.

    current directory: E:/ruby24x86/lib/ruby/gems/2.4.0/gems/mysql2-0.4.6/ext/mysql2
E:/ruby24x86/bin/ruby.exe -r ./siteconf20170625-6748-g1m887.rb extconf.rb --with-mysql-dir="C:/Program Files (x86)/MySQL/MySQL Connector C 6.1"
checking for rb_absint_size()... yes
checking for rb_absint_singlebit_p()... yes
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_blocking_region()... no
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
checking for rb_big_cmp()... yes
-----
Using --with-mysql-dir=C:/Program Files (x86)/MySQL/MySQL Connector C 6.1
-----
checking for mysql.h... yes
checking for SSL_MODE_DISABLED in mysql.h... yes
checking for SSL_MODE_PREFERRED in mysql.h... yes
checking for SSL_MODE_REQUIRED in mysql.h... yes
checking for SSL_MODE_VERIFY_CA in mysql.h... yes
checking for SSL_MODE_VERIFY_IDENTITY in mysql.h... yes
checking for errmsg.h... yes
checking for mysqld_error.h... yes
*** 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=E:/ruby24x86/bin/$(RUBY_BASE_NAME)
        --with-mysql-dir
        --with-mysql-include
        --without-mysql-include=${mysql-dir}/include
        --with-mysql-lib
        --without-mysql-lib=${mysql-dir}/lib
        --with-sanitize
        --without-sanitize
E:/ruby24x86/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task_manager.rb:58:in `[]': Don't know how to build task 'E:/ruby24x86/lib/ruby/gems/2.4.0/gems/mysql2-0.4.6/support/libmysql.def' (see --tasks) (RuntimeError)
        from E:/ruby24x86/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:61:in `lookup_prerequisite'
        from E:/ruby24x86/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:57:in `block in prerequisite_tasks'
        from E:/ruby24x86/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:57:in `map'
        from E:/ruby24x86/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:57:in `prerequisite_tasks'
        from E:/ruby24x86/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:214:in `invoke_prerequisites'
        from E:/ruby24x86/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:193:in `block in invoke_with_call_chain'

        from E:/ruby24x86/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
        from E:/ruby24x86/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
        from E:/ruby24x86/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:180:in `invoke'
        from extconf.rb:197:in `<main>'

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

  E:/ruby24x86/lib/ruby/gems/2.4.0/extensions/x86-mingw32/2.4.0/mysql2-0.4.6/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in E:/ruby24x86/lib/ruby/gems/2.4.0/gems/mysql2-0.4.6 for inspection.
Results logged to E:/ruby24x86/lib/ruby/gems/2.4.0/extensions/x86-mingw32/2.4.0/mysql2-0.4.6/gem_make.out

The content of mkmf.log file is shown as below:

have_func: checking for rb_absint_size()... -------------------- yes

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include conftest.c  -L. -LE:/ruby24x86/lib -L. -pipe     -lmsvcrt-ruby240  -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7:   return 0;
8: }
/* end */

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include conftest.c  -L. -LE:/ruby24x86/lib -L. -pipe     -lmsvcrt-ruby240  -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: 
 6: /*top*/
 7: extern int t(void);
 8: int main(int argc, char **argv)
 9: {
10:   if (argc > 1000000) {
11:     printf("%p", &t);
12:   }
13: 
14:   return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_absint_size; return !p; }
/* end */

--------------------

have_func: checking for rb_absint_singlebit_p()... -------------------- yes

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include conftest.c  -L. -LE:/ruby24x86/lib -L. -pipe     -lmsvcrt-ruby240  -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: 
 6: /*top*/
 7: extern int t(void);
 8: int main(int argc, char **argv)
 9: {
10:   if (argc > 1000000) {
11:     printf("%p", &t);
12:   }
13: 
14:   return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_absint_singlebit_p; return !p; }
/* end */

--------------------

have_header: checking for ruby/thread.h... -------------------- yes

"i686-w64-mingw32-gcc -E -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include  conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <ruby/thread.h>
/* end */

--------------------

have_func: checking for rb_thread_call_without_gvl() in ruby/thread.h... -------------------- yes

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include conftest.c  -L. -LE:/ruby24x86/lib -L. -pipe     -lmsvcrt-ruby240  -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: #include <ruby/thread.h>
 6: 
 7: /*top*/
 8: extern int t(void);
 9: int main(int argc, char **argv)
10: {
11:   if (argc > 1000000) {
12:     printf("%p", &t);
13:   }
14: 
15:   return 0;
16: }
17: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_thread_call_without_gvl; return !p; }
/* end */

--------------------

have_func: checking for rb_thread_blocking_region()... -------------------- no

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include conftest.c  -L. -LE:/ruby24x86/lib -L. -pipe     -lmsvcrt-ruby240  -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
conftest.c: In function 't':
conftest.c:16:57: error: 'rb_thread_blocking_region' undeclared (first use in this function)
 int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_thread_blocking_region; return !p; }
                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~
conftest.c:16:57: note: each undeclared identifier is reported only once for each function it appears in
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: 
 6: /*top*/
 7: extern int t(void);
 8: int main(int argc, char **argv)
 9: {
10:   if (argc > 1000000) {
11:     printf("%p", &t);
12:   }
13: 
14:   return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_thread_blocking_region; return !p; }
/* end */

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include conftest.c  -L. -LE:/ruby24x86/lib -L. -pipe     -lmsvcrt-ruby240  -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
C:\Users\jianh\AppData\Local\Temp\cc8qbCYP.o:conftest.c:(.text+0x4): undefined reference to `rb_thread_blocking_region'
collect2.exe: error: ld returned 1 exit status
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: 
 6: /*top*/
 7: extern int t(void);
 8: int main(int argc, char **argv)
 9: {
10:   if (argc > 1000000) {
11:     printf("%p", &t);
12:   }
13: 
14:   return 0;
15: }
16: extern void rb_thread_blocking_region();
17: int t(void) { rb_thread_blocking_region(); return 0; }
/* end */

--------------------

have_func: checking for rb_wait_for_single_fd()... -------------------- yes

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include conftest.c  -L. -LE:/ruby24x86/lib -L. -pipe     -lmsvcrt-ruby240  -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
conftest.c: In function 't':
conftest.c:16:57: error: 'rb_wait_for_single_fd' undeclared (first use in this function)
 int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_wait_for_single_fd; return !p; }
                                                         ^~~~~~~~~~~~~~~~~~~~~
conftest.c:16:57: note: each undeclared identifier is reported only once for each function it appears in
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: 
 6: /*top*/
 7: extern int t(void);
 8: int main(int argc, char **argv)
 9: {
10:   if (argc > 1000000) {
11:     printf("%p", &t);
12:   }
13: 
14:   return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_wait_for_single_fd; return !p; }
/* end */

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include conftest.c  -L. -LE:/ruby24x86/lib -L. -pipe     -lmsvcrt-ruby240  -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: 
 6: /*top*/
 7: extern int t(void);
 8: int main(int argc, char **argv)
 9: {
10:   if (argc > 1000000) {
11:     printf("%p", &t);
12:   }
13: 
14:   return 0;
15: }
16: extern void rb_wait_for_single_fd();
17: int t(void) { rb_wait_for_single_fd(); return 0; }
/* end */

--------------------

have_func: checking for rb_hash_dup()... -------------------- yes

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include conftest.c  -L. -LE:/ruby24x86/lib -L. -pipe     -lmsvcrt-ruby240  -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: 
 6: /*top*/
 7: extern int t(void);
 8: int main(int argc, char **argv)
 9: {
10:   if (argc > 1000000) {
11:     printf("%p", &t);
12:   }
13: 
14:   return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_hash_dup; return !p; }
/* end */

--------------------

have_func: checking for rb_intern3()... -------------------- yes

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include conftest.c  -L. -LE:/ruby24x86/lib -L. -pipe     -lmsvcrt-ruby240  -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
conftest.c: In function 't':
conftest.c:16:57: error: 'rb_intern3' undeclared (first use in this function)
 int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_intern3; return !p; }
                                                         ^~~~~~~~~~
conftest.c:16:57: note: each undeclared identifier is reported only once for each function it appears in
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: 
 6: /*top*/
 7: extern int t(void);
 8: int main(int argc, char **argv)
 9: {
10:   if (argc > 1000000) {
11:     printf("%p", &t);
12:   }
13: 
14:   return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_intern3; return !p; }
/* end */

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include conftest.c  -L. -LE:/ruby24x86/lib -L. -pipe     -lmsvcrt-ruby240  -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: 
 6: /*top*/
 7: extern int t(void);
 8: int main(int argc, char **argv)
 9: {
10:   if (argc > 1000000) {
11:     printf("%p", &t);
12:   }
13: 
14:   return 0;
15: }
16: extern void rb_intern3();
17: int t(void) { rb_intern3(); return 0; }
/* end */

--------------------

have_func: checking for rb_big_cmp()... -------------------- yes

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include conftest.c  -L. -LE:/ruby24x86/lib -L. -pipe     -lmsvcrt-ruby240  -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: 
 6: /*top*/
 7: extern int t(void);
 8: int main(int argc, char **argv)
 9: {
10:   if (argc > 1000000) {
11:     printf("%p", &t);
12:   }
13: 
14:   return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_big_cmp; return !p; }
/* end */

--------------------

have_header: checking for mysql.h... -------------------- yes

"i686-w64-mingw32-gcc -E -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include  conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <mysql.h>
/* end */

--------------------

have_const: checking for SSL_MODE_DISABLED in mysql.h... -------------------- yes

"i686-w64-mingw32-gcc -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include   -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <mysql.h>
6: 
7: /*top*/
8: typedef int conftest_type;
9: conftest_type conftestval = (int)SSL_MODE_DISABLED;
/* end */

--------------------

have_const: checking for SSL_MODE_PREFERRED in mysql.h... -------------------- yes

"i686-w64-mingw32-gcc -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include   -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <mysql.h>
6: 
7: /*top*/
8: typedef int conftest_type;
9: conftest_type conftestval = (int)SSL_MODE_PREFERRED;
/* end */

--------------------

have_const: checking for SSL_MODE_REQUIRED in mysql.h... -------------------- yes

"i686-w64-mingw32-gcc -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include   -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <mysql.h>
6: 
7: /*top*/
8: typedef int conftest_type;
9: conftest_type conftestval = (int)SSL_MODE_REQUIRED;
/* end */

--------------------

have_const: checking for SSL_MODE_VERIFY_CA in mysql.h... -------------------- yes

"i686-w64-mingw32-gcc -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include   -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <mysql.h>
6: 
7: /*top*/
8: typedef int conftest_type;
9: conftest_type conftestval = (int)SSL_MODE_VERIFY_CA;
/* end */

--------------------

have_const: checking for SSL_MODE_VERIFY_IDENTITY in mysql.h... -------------------- yes

"i686-w64-mingw32-gcc -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include   -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <mysql.h>
6: 
7: /*top*/
8: typedef int conftest_type;
9: conftest_type conftestval = (int)SSL_MODE_VERIFY_IDENTITY;
/* end */

--------------------

have_header: checking for errmsg.h... -------------------- yes

"i686-w64-mingw32-gcc -E -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include -DFULL_SSL_MODE_SUPPORT  conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <errmsg.h>
/* end */

--------------------

have_header: checking for mysqld_error.h... -------------------- yes

"i686-w64-mingw32-gcc -E -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include -DFULL_SSL_MODE_SUPPORT  conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <mysqld_error.h>
/* end */

--------------------

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include -DFULL_SSL_MODE_SUPPORT conftest.c  -L. -LE:/ruby24x86/lib -L"C:/Program Files (x86)/MySQL/MySQL Connector C 6.1/lib" -L. -pipe     -lmsvcrt-ruby240 -Werror -Weverything -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
i686-w64-mingw32-gcc: error: unrecognized command line option '-Weverything'
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main() {return 0;}
/* end */

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include -DFULL_SSL_MODE_SUPPORT conftest.c  -L. -LE:/ruby24x86/lib -L"C:/Program Files (x86)/MySQL/MySQL Connector C 6.1/lib" -L. -pipe     -lmsvcrt-ruby240 -Werror -Wno-bad-function-cast -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main() {return 0;}
/* end */

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include -DFULL_SSL_MODE_SUPPORT conftest.c  -L. -LE:/ruby24x86/lib -L"C:/Program Files (x86)/MySQL/MySQL Connector C 6.1/lib" -L. -pipe     -lmsvcrt-ruby240 -Werror -Wno-conditional-uninitialized -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main() {return 0;}
/* end */

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include -DFULL_SSL_MODE_SUPPORT conftest.c  -L. -LE:/ruby24x86/lib -L"C:/Program Files (x86)/MySQL/MySQL Connector C 6.1/lib" -L. -pipe     -lmsvcrt-ruby240 -Werror -Wno-covered-switch-default -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main() {return 0;}
/* end */

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include -DFULL_SSL_MODE_SUPPORT conftest.c  -L. -LE:/ruby24x86/lib -L"C:/Program Files (x86)/MySQL/MySQL Connector C 6.1/lib" -L. -pipe     -lmsvcrt-ruby240 -Werror -Wno-declaration-after-statement -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main() {return 0;}
/* end */

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include -DFULL_SSL_MODE_SUPPORT conftest.c  -L. -LE:/ruby24x86/lib -L"C:/Program Files (x86)/MySQL/MySQL Connector C 6.1/lib" -L. -pipe     -lmsvcrt-ruby240 -Werror -Wno-disabled-macro-expansion -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main() {return 0;}
/* end */

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include -DFULL_SSL_MODE_SUPPORT conftest.c  -L. -LE:/ruby24x86/lib -L"C:/Program Files (x86)/MySQL/MySQL Connector C 6.1/lib" -L. -pipe     -lmsvcrt-ruby240 -Werror -Wno-documentation-unknown-command -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main() {return 0;}
/* end */

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include -DFULL_SSL_MODE_SUPPORT conftest.c  -L. -LE:/ruby24x86/lib -L"C:/Program Files (x86)/MySQL/MySQL Connector C 6.1/lib" -L. -pipe     -lmsvcrt-ruby240 -Werror -Wno-missing-field-initializers -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main() {return 0;}
/* end */

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include -DFULL_SSL_MODE_SUPPORT conftest.c  -L. -LE:/ruby24x86/lib -L"C:/Program Files (x86)/MySQL/MySQL Connector C 6.1/lib" -L. -pipe     -lmsvcrt-ruby240 -Werror -Wno-missing-variable-declarations -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main() {return 0;}
/* end */

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include -DFULL_SSL_MODE_SUPPORT conftest.c  -L. -LE:/ruby24x86/lib -L"C:/Program Files (x86)/MySQL/MySQL Connector C 6.1/lib" -L. -pipe     -lmsvcrt-ruby240 -Werror -Wno-padded -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main() {return 0;}
/* end */

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include -DFULL_SSL_MODE_SUPPORT conftest.c  -L. -LE:/ruby24x86/lib -L"C:/Program Files (x86)/MySQL/MySQL Connector C 6.1/lib" -L. -pipe     -lmsvcrt-ruby240 -Werror -Wno-reserved-id-macro -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main() {return 0;}
/* end */

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include -DFULL_SSL_MODE_SUPPORT conftest.c  -L. -LE:/ruby24x86/lib -L"C:/Program Files (x86)/MySQL/MySQL Connector C 6.1/lib" -L. -pipe     -lmsvcrt-ruby240 -Werror -Wno-sign-conversion -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main() {return 0;}
/* end */

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include -DFULL_SSL_MODE_SUPPORT conftest.c  -L. -LE:/ruby24x86/lib -L"C:/Program Files (x86)/MySQL/MySQL Connector C 6.1/lib" -L. -pipe     -lmsvcrt-ruby240 -Werror -Wno-static-in-inline -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main() {return 0;}
/* end */

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include -DFULL_SSL_MODE_SUPPORT conftest.c  -L. -LE:/ruby24x86/lib -L"C:/Program Files (x86)/MySQL/MySQL Connector C 6.1/lib" -L. -pipe     -lmsvcrt-ruby240 -Werror -Wno-switch-enum -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main() {return 0;}
/* end */

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include -DFULL_SSL_MODE_SUPPORT conftest.c  -L. -LE:/ruby24x86/lib -L"C:/Program Files (x86)/MySQL/MySQL Connector C 6.1/lib" -L. -pipe     -lmsvcrt-ruby240 -Werror -Wno-undef -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main() {return 0;}
/* end */

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include -DFULL_SSL_MODE_SUPPORT conftest.c  -L. -LE:/ruby24x86/lib -L"C:/Program Files (x86)/MySQL/MySQL Connector C 6.1/lib" -L. -pipe     -lmsvcrt-ruby240 -Werror -Wno-unreachable-code -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main() {return 0;}
/* end */

"i686-w64-mingw32-gcc -o conftest.exe -IE:/ruby24x86/include/ruby-2.4.0/i386-mingw32 -IE:/ruby24x86/include/ruby-2.4.0/ruby/backward -IE:/ruby24x86/include/ruby-2.4.0 -I. "-IC:/Program Files (x86)/MySQL/MySQL Connector C 6.1/include" -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw32/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=i686 -mtune=generic -O2 -pipe -IC:/msys64/mingw32/lib/libffi-3.2.1/include -DFULL_SSL_MODE_SUPPORT conftest.c  -L. -LE:/ruby24x86/lib -L"C:/Program Files (x86)/MySQL/MySQL Connector C 6.1/lib" -L. -pipe     -lmsvcrt-ruby240 -Werror -Wno-used-but-marked-unused -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main() {return 0;}
/* end */

@araufit
Copy link
Author

araufit commented Jun 26, 2017

@wjh94. I have the same issue but i have not compile it. I have revert back too ruby 2.3 and used 2.3 mysql2.

@sodabrew
Copy link
Collaborator

sodabrew commented Jun 26, 2017 via email

@sodabrew sodabrew added this to the 0.5.0 milestone Jul 6, 2017
@sodabrew
Copy link
Collaborator

sodabrew commented Jul 6, 2017

The 0.5.0 series will include Ruby 2.4 for Windows.

@laoyouzi
Copy link

laoyouzi commented Jul 26, 2017

I have the same issue, my ruby version is 2.2.1. but my os is ubuntu 16.04

larskanis added a commit to larskanis/mysql2 that referenced this issue Jul 31, 2017
Since RubyInstaller-2.4+ is bundled with MSYS2 and the libmariadbclient
can be installed per gemspec library dependency, it is easy to build
the mysql2 gem in Windows.

The MSYS2/MINGW dependency feature is documented here:
https://github.com/oneclick/rubyinstaller2/wiki/For-gem-developers#msys2-library-dependency

This also adds ruby-2.4 binaries, so that the mysql2 is still usabel as
a binary gem.

Fixes brianmario#861
larskanis added a commit to larskanis/mysql2 that referenced this issue Jul 31, 2017
Since RubyInstaller-2.4+ is bundled with MSYS2 and the libmariadbclient
can be installed per gemspec library dependency, it is easy to build
the mysql2 gem in Windows.

The MSYS2/MINGW dependency feature is documented here:
https://github.com/oneclick/rubyinstaller2/wiki/For-gem-developers#msys2-library-dependency

This also adds ruby-2.4 binaries, so that the mysql2 is still usabel as
a binary gem.

Fixes brianmario#861
larskanis added a commit to larskanis/mysql2 that referenced this issue Jul 31, 2017
Since RubyInstaller-2.4+ is bundled with MSYS2 and the libmariadbclient
can be installed per gemspec library dependency, it is easy to build
the mysql2 gem in Windows.

The MSYS2/MINGW dependency feature is documented here:
https://github.com/oneclick/rubyinstaller2/wiki/For-gem-developers#msys2-library-dependency

This also adds ruby-2.4 binaries, so that the mysql2 is still usabel as
a binary gem.

Fixes brianmario#861
larskanis added a commit to larskanis/mysql2 that referenced this issue Jul 31, 2017
Since RubyInstaller-2.4+ is bundled with MSYS2 and the libmariadbclient
can be installed per gemspec library dependency, it is easy to build
the mysql2 gem in Windows.

The MSYS2/MINGW dependency feature is documented here:
https://github.com/oneclick/rubyinstaller2/wiki/For-gem-developers#msys2-library-dependency

This also adds ruby-2.4 binaries, so that the mysql2 is still usabel as
a binary gem.

Fixes brianmario#861
larskanis added a commit to larskanis/mysql2 that referenced this issue Jul 31, 2017
Since RubyInstaller-2.4+ is bundled with MSYS2 and the libmariadbclient
can be installed per gemspec library dependency, it is easy to build
the mysql2 gem in Windows.

The MSYS2/MINGW dependency feature is documented here:
https://github.com/oneclick/rubyinstaller2/wiki/For-gem-developers#msys2-library-dependency

This also adds ruby-2.4 binaries, so that the mysql2 is still usabel as
a binary gem.

Fixes brianmario#861
larskanis added a commit to larskanis/mysql2 that referenced this issue Jul 31, 2017
Since RubyInstaller-2.4+ is bundled with MSYS2 and the libmariadbclient
can be installed per gemspec library dependency, it is easy to build
the mysql2 gem in Windows.

The MSYS2/MINGW dependency feature is documented here:
https://github.com/oneclick/rubyinstaller2/wiki/For-gem-developers#msys2-library-dependency

This also adds ruby-2.4 binaries, so that the mysql2 is still usabel as
a binary gem.

Fixes brianmario#861
larskanis added a commit to larskanis/mysql2 that referenced this issue Jul 31, 2017
Since RubyInstaller-2.4+ is bundled with MSYS2 and the libmariadbclient
can be installed per gemspec library dependency, it is easy to build
the mysql2 gem in Windows.

The MSYS2/MINGW dependency feature is documented here:
https://github.com/oneclick/rubyinstaller2/wiki/For-gem-developers#msys2-library-dependency

This also adds ruby-2.4 binaries, so that the mysql2 is still usabel as
a binary gem.

Fixes brianmario#861

The change in the spec is required for mariadbclient. It throws an error
if no query was executed.

Due to the stdcall convention on i686, the mysql_query() function check
must be called with a valid header file. It is therefore separated from
the find_library call.
larskanis added a commit to larskanis/mysql2 that referenced this issue Jul 31, 2017
Since RubyInstaller-2.4+ is bundled with MSYS2 and the libmariadbclient
can be installed per gemspec library dependency, it is easy to build
the mysql2 gem in Windows.

The MSYS2/MINGW dependency feature is documented here:
https://github.com/oneclick/rubyinstaller2/wiki/For-gem-developers#msys2-library-dependency

This also adds ruby-2.4 binaries, so that the mysql2 is still usabel as
a binary gem.

Fixes brianmario#861

The change in the spec is required for mariadbclient. It throws an error
if no query was executed.

Due to the stdcall convention on i686, the mysql_query() function check
must be called with a valid header file. It is therefore separated from
the find_library call.
larskanis added a commit to larskanis/mysql2 that referenced this issue Jul 31, 2017
Since RubyInstaller-2.4+ is bundled with MSYS2 and the libmariadbclient
can be installed per gemspec library dependency, it is easy to build
the mysql2 gem in Windows.

The MSYS2/MINGW dependency feature is documented here:
https://github.com/oneclick/rubyinstaller2/wiki/For-gem-developers#msys2-library-dependency

This also adds ruby-2.4 binaries, so that the mysql2 is still usabel as
a binary gem.

Fixes brianmario#861

The change in the spec is required for mariadbclient. It throws an error
if no query was executed.

Due to the stdcall convention on i686, the mysql_query() function check
must be called with a valid header file. It is therefore separated from
the find_library call.
larskanis added a commit to larskanis/mysql2 that referenced this issue Jul 31, 2017
Since RubyInstaller-2.4+ is bundled with MSYS2 and the libmariadbclient
can be installed per gemspec library dependency, it is easy to build
the mysql2 gem in Windows.

The MSYS2/MINGW dependency feature is documented here:
https://github.com/oneclick/rubyinstaller2/wiki/For-gem-developers#msys2-library-dependency

This also adds ruby-2.4 binaries, so that the mysql2 is still usabel as
a binary gem.

Fixes brianmario#861

The change in the spec is required for mariadbclient. It throws an error
if no query was executed.

Due to the stdcall convention on i686, the mysql_query() function check
fails, so that it is omitted, now.
larskanis added a commit to larskanis/mysql2 that referenced this issue Jul 31, 2017
Since RubyInstaller-2.4+ is bundled with MSYS2 and the libmariadbclient
can be installed per gemspec library dependency, it is easy to build
the mysql2 gem in Windows.

The MSYS2/MINGW dependency feature is documented here:
https://github.com/oneclick/rubyinstaller2/wiki/For-gem-developers#msys2-library-dependency

This also adds ruby-2.4 binaries, so that the mysql2 is still usabel as
a binary gem.

Fixes brianmario#861

The change in the spec is required for mariadbclient. It throws an error
if no query was executed.

Due to the stdcall convention on i686, the mysql_query() function check
fails, so that it is omitted, now.
larskanis added a commit to larskanis/mysql2 that referenced this issue Jul 31, 2017
Since RubyInstaller-2.4+ is bundled with MSYS2 and the libmariadbclient
can be installed per gemspec library dependency, it is easy to build
the mysql2 gem in Windows.

The MSYS2/MINGW dependency feature is documented here:
https://github.com/oneclick/rubyinstaller2/wiki/For-gem-developers#msys2-library-dependency

This also adds ruby-2.4 binaries, so that the mysql2 is still usabel as
a binary gem.

Fixes brianmario#861

The change in the spec is required for mariadbclient. It throws an error
if no query was executed.

Due to the stdcall convention on i686, the mysql_query() function check
fails, so that it is omitted, now.
@soundasleep
Copy link

Is there any ETA as to when this may be resolved, or 0.5.0 may be released?

@fatalerrorx
Copy link

+1 Experiencing the same problem. Any updates?

@nengine
Copy link

nengine commented Sep 30, 2017

Same here with Ruby 2.4.1 on Windows 10. Thanks.

@mode-x
Copy link

mode-x commented Oct 9, 2017

Please can you give an estimated time of when to expect 0.5.0?

@Desseler
Copy link

I'm also in the same boat. Using Ruby 2.4 on Windows 10 doesn't work with the MySQL2 gem. Library is missing.

@sodabrew
Copy link
Collaborator

The next release will be sometime this quarter. So as a workaround until then, I have these suggestions:

  1. Use Ruby 2.3 for now.
  2. Compile mysql2 locally with gem install mysql2 --platform ruby

@nengine
Copy link

nengine commented Oct 10, 2017

Worked for me on Ruby 2.4.3 on Windows 10 as shown below. Be sure to get the Mysql server (or) MySQL C connector where it includes lib and include folders.

C:\Users\nash\excg>gem install mysql2 --platform=ruby -- '--with-mysql-lib="I:\mysql-5.7.19-winx64\lib" --with-mysql-include="I:\mysql-5.7.19-winx64\include"'
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions with: '--with-mysql-lib="I:\mysql-5.7.19-winx64\lib" --with-mysql-include="I:\mysql-5.7.19-winx64\include"'
This could take a while...
Successfully installed mysql2-0.4.9
Parsing documentation for mysql2-0.4.9
Installing ri documentation for mysql2-0.4.9
Done installing documentation for mysql2 after 1 seconds
1 gem installed

sodabrew pushed a commit that referenced this issue Nov 25, 2017
Since RubyInstaller-2.4+ is bundled with MSYS2 and the libmariadbclient
can be installed per gemspec library dependency, it is easy to build
the mysql2 gem in Windows.

The MSYS2/MINGW dependency feature is documented here:
https://github.com/oneclick/rubyinstaller2/wiki/For-gem-developers#msys2-library-dependency

This also adds ruby-2.4 binaries, so that the mysql2 is still usabel as
a binary gem.

Fixes #861

The change in the spec is required for mariadbclient. It throws an error
if no query was executed.

Due to the stdcall convention on i686, the mysql_query() function check
fails, so that it is omitted, now.
junaruga added a commit to junaruga/mysql2 that referenced this issue Nov 27, 2017
Since RubyInstaller-2.4+ is bundled with MSYS2 and the libmariadbclient
can be installed per gemspec library dependency, it is easy to build
the mysql2 gem in Windows.

The MSYS2/MINGW dependency feature is documented here:
https://github.com/oneclick/rubyinstaller2/wiki/For-gem-developers#msys2-library-dependency

This also adds ruby-2.4 binaries, so that the mysql2 is still usabel as
a binary gem.

Fixes brianmario#861

The change in the spec is required for mariadbclient. It throws an error
if no query was executed.

Due to the stdcall convention on i686, the mysql_query() function check
fails, so that it is omitted, now.

Signed-off-by: Jun Aruga <[email protected]>
@devzilenas
Copy link

devzilenas commented Feb 11, 2018

If using nengines solution (compiling yourself) make sure there is no trailing slash at the end of lib dir and at the end of include dir . If there is a slash it will not compile.

@mattcsully
Copy link

Thank you @nengine That worked for me also.
`Windows 10
ruby 2.4.3p205 (2017-12-14 revision 61247) [x64-mingw32]

C:\dev\react>gem install mysql2 --platform=ruby -- '--with-mysql-lib="C:\mysql-5.7.21-winx64\lib" --with-mysql-include="C:\mysql-5.7.21-winx64\include"'
Fetching: mysql2-0.4.10.gem (100%)
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions with: '--with-mysql-lib="C:\mysql-5.7.21-winx64\lib" --with-mysql-include="C:\mysql-5.7.21-winx64\include"'
This could take a while...
Successfully installed mysql2-0.4.10
Parsing documentation for mysql2-0.4.10
Installing ri documentation for mysql2-0.4.10
Done installing documentation for mysql2 after 1 seconds
1 gem installed`

@BMahabir
Copy link

Sigh well it doesn't work for me....

C:\rails_project\market-tracker>gem install mysql2 --platform=ruby -- '--with-mysql-lib="C:\mysql-connector-C-61\lib" --with-mysql-include="C:\mysql-connector-C-61\include"'
Temporarily enhancing PATH for MSYS/MINGW...
Installing required msys2 packages: mingw-w64-x86_64-libmariadbclient
warning: mingw-w64-x86_64-libmariadbclient-2.3.4-1 is up to date -- skipping
Building native extensions with: '--with-mysql-lib="C:\mysql-connector-C-61\lib" --with-mysql-include="C:\mysql-connector-C-61\include"'
This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.

current directory: C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mysql2-0.5.0/ext/mysql2

C:/Ruby24-x64/bin/ruby.exe -r ./siteconf20180327-9056-1hzh8yu.rb extconf.rb --with-mysql-lib="C:\mysql-connector-C-61\lib" --with-mysql-include="C:\mysql-connector-C-61\include"
checking for rb_absint_size()... yes
checking for rb_absint_singlebit_p()... yes
checking for rb_wait_for_single_fd()... yes

Using --with-mysql-dir=C:\mysql-connector-C-61

checking for mysql.h... yes
checking for errmsg.h... yes
checking for SSL_MODE_DISABLED in mysql.h... yes
checking for SSL_MODE_PREFERRED in mysql.h... yes
checking for SSL_MODE_REQUIRED in mysql.h... yes
checking for SSL_MODE_VERIFY_CA in mysql.h... yes
checking for SSL_MODE_VERIFY_IDENTITY in mysql.h... yes
checking for MYSQL.net.vio in mysql.h... yes
checking for MYSQL.net.pvio in mysql.h... no
checking for MYSQL_ENABLE_CLEARTEXT_PLUGIN in mysql.h... yes
checking for SERVER_QUERY_NO_GOOD_INDEX_USED in mysql.h... yes
checking for SERVER_QUERY_NO_INDEX_USED in mysql.h... yes
checking for SERVER_QUERY_WAS_SLOW in mysql.h... yes
checking for MYSQL_OPTION_MULTI_STATEMENTS_ON in mysql.h... yes
checking for MYSQL_OPTION_MULTI_STATEMENTS_OFF in mysql.h... yes
checking for my_bool in mysql.h... yes
creating Makefile

current directory: C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mysql2-0.5.0/ext/mysql2
make "DESTDIR=" clean

current directory: C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mysql2-0.5.0/ext/mysql2
make "DESTDIR="
generating mysql2-x64-mingw32.def
compiling client.c
compiling infile.c
compiling mysql2_ext.c
compiling result.c
compiling statement.c
linking shared-object mysql2/mysql2.so
client.o:client.c:(.text+0x1d0): undefined reference to mysql_send_query' client.o:client.c:(.text+0x224): undefined reference to mysql_real_connect'
client.o:client.c:(.text+0x2a9): undefined reference to mysql_options4' client.o:client.c:(.text+0x2cd): undefined reference to mysql_init'
client.o:client.c:(.text+0x38f): undefined reference to mysql_options' client.o:client.c:(.text+0x3c4): undefined reference to mysql_options'
client.o:client.c:(.text+0x3d5): undefined reference to mysql_error' client.o:client.c:(.text+0x416): undefined reference to mysql_options'
client.o:client.c:(.text+0x446): undefined reference to mysql_options' client.o:client.c:(.text+0x7a3): undefined reference to mysql_ssl_set'
client.o:client.c:(.text+0x7e0): undefined reference to mysql_get_ssl_cipher' client.o:client.c:(.text+0x830): undefined reference to mysql_info'
client.o:client.c:(.text+0x87b): undefined reference to mysql_warning_count' client.o:client.c:(.text+0x8ad): undefined reference to mysql_use_result'
client.o:client.c:(.text+0x8cd): undefined reference to mysql_store_result' client.o:client.c:(.text+0x8fb): undefined reference to mysql_more_results'
client.o:client.c:(.text+0x93a): undefined reference to mysql_set_server_option' client.o:client.c:(.text+0x96c): undefined reference to mysql_select_db'
client.o:client.c:(.text+0x985): undefined reference to mysql_ping' client.o:client.c:(.text+0x9a5): undefined reference to mysql_read_query_result'
client.o:client.c:(.text+0xa1d): undefined reference to mysql_get_server_version' client.o:client.c:(.text+0xa3d): undefined reference to mysql_get_server_info'
client.o:client.c:(.text+0xb7c): undefined reference to mysql_real_escape_string' client.o:client.c:(.text+0xc6a): undefined reference to mysql_escape_string'
client.o:client.c:(.text+0xd40): undefined reference to mysql_get_client_info' client.o:client.c:(.text+0xd84): undefined reference to mysql_get_client_version'
client.o:client.c:(.text+0xe02): undefined reference to mysql_error' client.o:client.c:(.text+0xe15): undefined reference to mysql_sqlstate'
client.o:client.c:(.text+0xe48): undefined reference to mysql_errno' client.o:client.c:(.text+0x10f4): undefined reference to mysql_options'
client.o:client.c:(.text+0x1188): undefined reference to mysql_options' client.o:client.c:(.text+0x1205): undefined reference to mysql_get_server_version'
client.o:client.c:(.text+0x1253): undefined reference to mysql_options' client.o:client.c:(.text+0x1276): undefined reference to mysql_options'
client.o:client.c:(.text+0x131a): undefined reference to mysql_errno' client.o:client.c:(.text+0x135b): undefined reference to mysql_next_result'
client.o:client.c:(.text+0x13c5): undefined reference to mysql_next_result' client.o:client.c:(.text+0x13e8): undefined reference to mysql_more_results'
client.o:client.c:(.text+0x1404): undefined reference to mysql_free_result' client.o:client.c:(.text+0x144f): undefined reference to mysql_thread_id'
client.o:client.c:(.text+0x152f): undefined reference to mysql_affected_rows' client.o:client.c:(.text+0x15af): undefined reference to mysql_insert_id'
client.o:client.c:(.text+0x162d): undefined reference to mysql_get_client_version' client.o:client.c:(.text+0x166f): undefined reference to mysql_options'
client.o:client.c:(.text+0x1716): undefined reference to mysql_close' client.o:client.c:(.text+0x1774): undefined reference to mysql_close'
client.o:client.c:(.text+0x1872): undefined reference to mysql_options' client.o:client.c:(.text+0x187f): undefined reference to mysql_error'
client.o:client.c:(.text+0x1bb5): undefined reference to mysql_get_client_info' client.o:client.c:(.text+0x1c1a): undefined reference to mysql_server_init'
client.o:client.c:(.text+0x2eb6): undefined reference to mysql_errno' infile.o:infile.c:(.text+0x21b): undefined reference to mysql_set_local_infile_handler'
result.o:result.c:(.text+0x7e): undefined reference to mysql_stmt_num_rows' result.o:result.c:(.text+0xb5): undefined reference to mysql_num_rows'
result.o:result.c:(.text+0x13b): undefined reference to mysql_fetch_field_direct' result.o:result.c:(.text+0x195): undefined reference to mysql_num_fields'
result.o:result.c:(.text+0x295): undefined reference to mysql_num_fields' result.o:result.c:(.text+0x2f5): undefined reference to mysql_stmt_fetch'
result.o:result.c:(.text+0x397): undefined reference to mysql_free_result' result.o:result.c:(.text+0x3d5): undefined reference to mysql_stmt_free_result'
result.o:result.c:(.text+0x6db): undefined reference to mysql_fetch_fields' result.o:result.c:(.text+0x76f): undefined reference to mysql_error'
result.o:result.c:(.text+0x7c9): undefined reference to mysql_fetch_fields' result.o:result.c:(.text+0x8c8): undefined reference to mysql_data_seek'
result.o:result.c:(.text+0x942): undefined reference to mysql_stmt_num_rows' result.o:result.c:(.text+0xa05): undefined reference to mysql_num_rows'
result.o:result.c:(.text+0xbef): undefined reference to mysql_stmt_bind_result' result.o:result.c:(.text+0xee8): undefined reference to mysql_num_fields'
result.o:result.c:(.text+0x191f): undefined reference to mysql_fetch_lengths' result.o:result.c:(.text+0x22fe): undefined reference to mysql_num_fields'
result.o:result.c:(.text+0x2b1): undefined reference to mysql_fetch_row' statement.o:statement.c:(.text+0x12): undefined reference to mysql_stmt_close'
statement.o:statement.c:(.text+0x40): undefined reference to mysql_stmt_prepare' statement.o:statement.c:(.text+0x85): undefined reference to mysql_stmt_execute'
statement.o:statement.c:(.text+0x137): undefined reference to mysql_stmt_insert_id' statement.o:statement.c:(.text+0x197): undefined reference to mysql_stmt_field_count'
statement.o:statement.c:(.text+0x207): undefined reference to mysql_stmt_param_count' statement.o:statement.c:(.text+0x25e): undefined reference to mysql_stmt_close'
statement.o:statement.c:(.text+0x298): undefined reference to mysql_stmt_close' statement.o:statement.c:(.text+0x2e8): undefined reference to mysql_stmt_error'
statement.o:statement.c:(.text+0x2fc): undefined reference to mysql_stmt_sqlstate' statement.o:statement.c:(.text+0x35b): undefined reference to mysql_stmt_errno'
statement.o:statement.c:(.text+0x3e7): undefined reference to mysql_stmt_affected_rows' statement.o:statement.c:(.text+0x4aa): undefined reference to mysql_stmt_result_metadata'
statement.o:statement.c:(.text+0x4be): undefined reference to mysql_fetch_fields' statement.o:statement.c:(.text+0x4c9): undefined reference to mysql_stmt_field_count'
statement.o:statement.c:(.text+0x528): undefined reference to mysql_free_result' statement.o:statement.c:(.text+0x544): undefined reference to mysql_stmt_errno'
statement.o:statement.c:(.text+0x625): undefined reference to mysql_stmt_param_count' statement.o:statement.c:(.text+0x815): undefined reference to mysql_stmt_result_metadata'
statement.o:statement.c:(.text+0x885): undefined reference to mysql_stmt_store_result' statement.o:statement.c:(.text+0x9ed): undefined reference to mysql_stmt_bind_param'
statement.o:statement.c:(.text+0xbd4): undefined reference to mysql_stmt_errno' statement.o:statement.c:(.text+0x103a): undefined reference to mysql_free_result'
statement.o:statement.c:(.text+0x110c): undefined reference to mysql_stmt_init' statement.o:statement.c:(.text+0x113c): undefined reference to mysql_stmt_attr_set'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:259: mysql2.so] Error 1

make failed, exit code 2

Gem files will remain installed in C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mysql2-0.5.0 for inspection.
Results logged to C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/mysql2-0.5.0/gem_make.out

@sodabrew
Copy link
Collaborator

With mysql2 0.5.0 you can use the Windows binaries for Ruby 2.4 and 2.5 now (remove --platform ruby from your gem line)

@BMahabir
Copy link

So you're saying just "gem install mysql2" with nothing else? I still get this error when I try to run rspec : Failure/Error: require File.expand_path("../../config/environment", FILE)

Gem::LoadError:
Specified 'mysql2' for database adapter, but the gem is not loaded. Add gem 'mysql2' to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).

./config/environment.rb:4:in `<top (required)>'

./spec/spec_helper.rb:64:in `<top (required)>'

./spec/routing/scoring_rules_routing_spec.rb:1:in `<top (required)>'

------------------

--- Caused by: ---

Gem::LoadError:

can't activate mysql2 (< 0.5, >= 0.3.13), already activated mysql2-0.5.0-x64-mingw32. Make sure all dependencies are added to Gemfile.

./config/environment.rb:4:in `<top (required)>'

@sodabrew
Copy link
Collaborator

Yep you'll need an upcoming point release of Rails 5.x to support mysql2 0.5.x as well. Sorry that you're blocked on that now!

@BMahabir
Copy link

So in order to upgrade Rails and have it run with our application, I need to downgrade ruby to 2.3.x? 'cause I'm not getting these guys to agree to upgrade to Rails 5.x anytime soon.

@sodabrew
Copy link
Collaborator

Yes, sorry to say, you won't be able to use Rails 4 and mysql2 0.4 and Ruby 2.4/2.5 precompiled.

@AlchemistCamp
Copy link

This is why Ruby and Rails stayed niche. Python and other language ecosystems weren't broken on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests