How can I get mysql2 to install?-Collection of common programming errors
I’m completely new to rails development and have been struggling with installing mysql2 with the past month. I’m have windows 8.1 64 bit, ruby 2.0.0p535 64bit, rails 4.0.2, and I have mysql2 (0.3.14) 64bit. The errors that I am getting from cmd are below.
C:\Users\tghol_000>gem install mysql2 --platform=ruby -- '--with-mysql-dir="C:\mysql-connector\"' --with-mysql lib="C:\mysql-connector\lib"' Temporarily enhancing PATH to include DevKit... Building native extensions with: '--with-mysql-dir="C:\mysql-connector\" --with-mysql-lib=C:\mysql- connector\lib' This could take a while... *** 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:/Ruby200-x64/bin/ruby --with-mysql-dir --with-mysql-include --without-mysql-include=${mysql-dir}/include --with-mysql-lib --without-mysql-lib=${mysql-dir}/ --with-mysql-dir --with-mysql-include --without-mysql-include=${mysql-dir}/include --with-mysql-lib --without-mysql-lib=${mysql-dir}/lib C:/Ruby200-x64/lib/ruby/2.0.0/shellwords.rb:75:in `block in shellsplit': Unmatched double quote: "\"-IC:\\mysql-connector\" --with-mysql-lib=C:\\mysql-connector\\lib 2>&1/include\" -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 $(DEFS) $(cppflags)" (ArgumentError) from C:/Ruby200-x64/lib/ruby/2.0.0/shellwords.rb:73:in `scan' from C:/Ruby200-x64/lib/ruby/2.0.0/shellwords.rb:73:in `shellsplit' from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:1687:in `dir_config' from extconf.rb:42:in `' ERROR: Error installing mysql2: ERROR: Failed to build gem native extension. C:/Ruby200-x64/bin/ruby.exe extconf.rb --with-mysql-dir="C:\mysql-connector\" --with- mysql-lib=C:\mysql-connector\lib checking for ruby/thread.h... yes checking for rb_thread_call_without_gvl() 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 extconf failed, exit code 1 Gem files will remain installed in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql2-0.3.14 for inspection. Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/extensions/x64-mingw32/2.0.0/mysql2-0.3.14/gem_make.out
mkmf.log
have_header: checking for ruby/thread.h... -------------------- yes
"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32 -IC:/Ruby200-x64/include/ruby-2.0.0/ruby/backward -IC:/Ruby200-x64/include/ruby-2.0.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/Ruby200-x64/lib -L. -lx64-msvcrt-ruby200 -lshell32 -lws2_32 -limagehlp -lshlwapi "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include
4: #include
5: int main(int argc, char **argv)
6: {
7: return 0;
8: }
/* end */
"x86_64-w64-mingw32-gcc -E -IC:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32 -IC:/Ruby200-x64/include/ruby-2.0.0/ruby/backward -IC:/Ruby200-x64/include/ruby-2.0.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include
4: #include
5: #include
/* end */
--------------------
have_func: checking for rb_thread_call_without_gvl() in ruby/thread.h... -------------------- yes
"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32 -IC:/Ruby200-x64/include/ruby-2.0.0/ruby/backward -IC:/Ruby200-x64/include/ruby-2.0.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/Ruby200-x64/lib -L. -lx64-msvcrt-ruby200 -lshell32 -lws2_32 -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:9:32: warning: variable 'p' set but not used [-Wunused-but-set-variable]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include
4: #include
5: #include
6:
7: /*top*/
8: extern int t(void);
9: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_thread_call_without_gvl; return 0; }
10: int main(int argc, char **argv)
11: {
12: if (argc > 1000000) {
13: printf("%p", &t);
14: }
15:
16: return 0;
17: }
/* end */
--------------------
have_func: checking for rb_thread_blocking_region()... -------------------- yes
"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32 -IC:/Ruby200-x64/include/ruby-2.0.0/ruby/backward -IC:/Ruby200-x64/include/ruby-2.0.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/Ruby200-x64/lib -L. -lx64-msvcrt-ruby200 -lshell32 -lws2_32 -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:8:1: warning: 'rb_thread_blocking_region' is deprecated (declared at C:/Ruby200-x64/include/ruby-2.0.0/ruby/intern.h:841) [-Wdeprecated-declarations]
conftest.c:8:32: warning: variable 'p' set but not used [-Wunused-but-set-variable]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include
4: #include
5:
6: /*top*/
7: extern int t(void);
8: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_thread_blocking_region; return 0; }
9: int main(int argc, char **argv)
10: {
11: if (argc > 1000000) {
12: printf("%p", &t);
13: }
14:
15: return 0;
16: }
/* end */
--------------------
have_func: checking for rb_wait_for_single_fd()... -------------------- yes
"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32 -IC:/Ruby200-x64/include/ruby-2.0.0/ruby/backward -IC:/Ruby200-x64/include/ruby-2.0.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/Ruby200-x64/lib -L. -lx64-msvcrt-ruby200 -lshell32 -lws2_32 -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:8:57: error: 'rb_wait_for_single_fd' undeclared (first use in this function)
conftest.c:8:57: note: each undeclared identifier is reported only once for each function it appears in
conftest.c:8:32: warning: variable 'p' set but not used [-Wunused-but-set-variable]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include
4: #include
5:
6: /*top*/
7: extern int t(void);
8: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_wait_for_single_fd; return 0; }
9: int main(int argc, char **argv)
10: {
11: if (argc > 1000000) {
12: printf("%p", &t);
13: }
14:
15: return 0;
16: }
/* end */
"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32 -IC:/Ruby200-x64/include/ruby-2.0.0/ruby/backward -IC:/Ruby200-x64/include/ruby-2.0.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/Ruby200-x64/lib -L. -lx64-msvcrt-ruby200 -lshell32 -lws2_32 -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:8:1: warning: implicit declaration of function 'rb_wait_for_single_fd' [-Wimplicit-function-declaration]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include
4: #include
5:
6: /*top*/
7: extern int t(void);
8: int t(void) { rb_wait_for_single_fd(); return 0; }
9: int main(int argc, char **argv)
10: {
11: if (argc > 1000000) {
12: printf("%p", &t);
13: }
14:
15: return 0;
16: }
/* end */
--------------------
have_func: checking for rb_hash_dup()... -------------------- yes
"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32 -IC:/Ruby200-x64/include/ruby-2.0.0/ruby/backward -IC:/Ruby200-x64/include/ruby-2.0.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/Ruby200-x64/lib -L. -lx64-msvcrt-ruby200 -lshell32 -lws2_32 -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:8:32: warning: variable 'p' set but not used [-Wunused-but-set-variable]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include
4: #include
5:
6: /*top*/
7: extern int t(void);
8: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_hash_dup; return 0; }
9: int main(int argc, char **argv)
10: {
11: if (argc > 1000000) {
12: printf("%p", &t);
13: }
14:
15: return 0;
16: }
/* end */
--------------------
have_func: checking for rb_intern3()... -------------------- yes
"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32 -IC:/Ruby200-x64/include/ruby-2.0.0/ruby/backward -IC:/Ruby200-x64/include/ruby-2.0.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/Ruby200-x64/lib -L. -lx64-msvcrt-ruby200 -lshell32 -lws2_32 -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:8:57: error: 'rb_intern3' undeclared (first use in this function)
conftest.c:8:57: note: each undeclared identifier is reported only once for each function it appears in
conftest.c:8:32: warning: variable 'p' set but not used [-Wunused-but-set-variable]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include
4: #include
5:
6: /*top*/
7: extern int t(void);
8: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_intern3; return 0; }
9: int main(int argc, char **argv)
10: {
11: if (argc > 1000000) {
12: printf("%p", &t);
13: }
14:
15: return 0;
16: }
/* end */
"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32 -IC:/Ruby200-x64/include/ruby-2.0.0/ruby/backward -IC:/Ruby200-x64/include/ruby-2.0.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/Ruby200-x64/lib -L. -lx64-msvcrt-ruby200 -lshell32 -lws2_32 -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:8:1: warning: implicit declaration of function 'rb_intern3' [-Wimplicit-function-declaration]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include
4: #include
5:
6: /*top*/
7: extern int t(void);
8: int t(void) { rb_intern3(); return 0; }
9: int main(int argc, char **argv)
10: {
11: if (argc > 1000000) {
12: printf("%p", &t);
13: }
14:
15: return 0;
16: }
/* end */
--------------------