{"id":7363,"date":"2014-06-07T02:36:27","date_gmt":"2014-06-07T02:36:27","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/06\/07\/how-can-i-get-mysql2-to-install-collection-of-common-programming-errors\/"},"modified":"2014-06-07T02:36:27","modified_gmt":"2014-06-07T02:36:27","slug":"how-can-i-get-mysql2-to-install-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/06\/07\/how-can-i-get-mysql2-to-install-collection-of-common-programming-errors\/","title":{"rendered":"How can I get mysql2 to install?-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m completely new to rails development and have been struggling with installing mysql2 with the past month. I&#8217;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.<\/p>\n<pre>\nC:\\Users\\tghol_000&gt;gem install mysql2 --platform=ruby -- '--with-mysql-dir=\"C:\\mysql-connector\\\"' --with-mysql         lib=\"C:\\mysql-connector\\lib\"'\n    Temporarily enhancing PATH to include DevKit...\n    Building native extensions with: '--with-mysql-dir=\"C:\\mysql-connector\\\" --with-mysql-lib=C:\\mysql-    connector\\lib'\n    This could take a while...\n    *** extconf.rb failed ***\n    Could not create Makefile due to some reason, probably lack of necessary\n    libraries and\/or headers.  Check the mkmf.log file for more details.  You may\n    need configuration options.\n\n    Provided configuration options:\n            --with-opt-dir\n        --without-opt-dir\n        --with-opt-include\n        --without-opt-include=${opt-dir}\/include\n        --with-opt-lib\n        --without-opt-lib=${opt-dir}\/lib\n        --with-make-prog\n        --without-make-prog\n        --srcdir=.\n        --curdir\n        --ruby=C:\/Ruby200-x64\/bin\/ruby\n        --with-mysql-dir\n        --with-mysql-include\n        --without-mysql-include=${mysql-dir}\/include\n        --with-mysql-lib\n        --without-mysql-lib=${mysql-dir}\/\n        --with-mysql-dir\n        --with-mysql-include\n        --without-mysql-include=${mysql-dir}\/include\n        --with-mysql-lib\n        --without-mysql-lib=${mysql-dir}\/lib\nC:\/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&gt;&amp;1\/include\\\" -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 $(DEFS) $(cppflags)\"\n (ArgumentError)\n        from C:\/Ruby200-x64\/lib\/ruby\/2.0.0\/shellwords.rb:73:in `scan'\n        from C:\/Ruby200-x64\/lib\/ruby\/2.0.0\/shellwords.rb:73:in `shellsplit'\n        from C:\/Ruby200-x64\/lib\/ruby\/2.0.0\/mkmf.rb:1687:in `dir_config'\n        from extconf.rb:42:in `' \nERROR:  Error installing mysql2:\n        ERROR: Failed to build gem native extension.\n\n    C:\/Ruby200-x64\/bin\/ruby.exe extconf.rb --with-mysql-dir=\"C:\\mysql-connector\\\" --with-        mysql-lib=C:\\mysql-connector\\lib\n        checking for ruby\/thread.h... yes\n        checking for rb_thread_call_without_gvl()\n        checking for rb_thread_blocking_region()... yes\n        checking for rb_wait_for_single_fd()... yes\n        checking for rb_hash_dup()... yes\n        checking for rb_intern3()... yes\n\n        extconf failed, exit code 1\n\nGem files will remain installed in C:\/Ruby200-x64\/lib\/ruby\/gems\/2.0.0\/gems\/mysql2-0.3.14 for inspection.\nResults logged to C:\/Ruby200-x64\/lib\/ruby\/gems\/2.0.0\/extensions\/x64-mingw32\/2.0.0\/mysql2-0.3.14\/gem_make.out\n<\/pre>\n<p>mkmf.log<\/p>\n<pre><code>have_header: checking for ruby\/thread.h... -------------------- yes\n\n\"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  \"\nchecked program was:\n\/* begin *\/\n1: #include \"ruby.h\"\n2: \n3: #include \n4: #include \n5: int main(int argc, char **argv)\n6: {\n7:   return 0;\n8: }\n\/* end *\/\n\n\"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\"\nchecked program was:\n\/* begin *\/\n1: #include \"ruby.h\"\n2: \n3: #include \n4: #include \n5: #include \n\/* end *\/\n\n--------------------\n\nhave_func: checking for rb_thread_call_without_gvl() in ruby\/thread.h... -------------------- yes\n\n\"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  \"\nconftest.c: In function 't':\nconftest.c:9:32: warning: variable 'p' set but not used [-Wunused-but-set-variable]\nchecked program was:\n\/* begin *\/\n 1: #include \"ruby.h\"\n 2: \n 3: #include \n 4: #include \n 5: #include \n 6: \n 7: \/*top*\/\n 8: extern int t(void);\n 9: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_thread_call_without_gvl; return 0; }\n10: int main(int argc, char **argv)\n11: {\n12:   if (argc &gt; 1000000) {\n13:     printf(\"%p\", &amp;t);\n14:   }\n15: \n16:   return 0;\n17: }\n\/* end *\/\n\n--------------------\n\nhave_func: checking for rb_thread_blocking_region()... -------------------- yes\n\n\"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  \"\nconftest.c: In function 't':\nconftest.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]\nconftest.c:8:32: warning: variable 'p' set but not used [-Wunused-but-set-variable]\nchecked program was:\n\/* begin *\/\n 1: #include \"ruby.h\"\n 2: \n 3: #include \n 4: #include \n 5: \n 6: \/*top*\/\n 7: extern int t(void);\n 8: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_thread_blocking_region; return 0; }\n 9: int main(int argc, char **argv)\n10: {\n11:   if (argc &gt; 1000000) {\n12:     printf(\"%p\", &amp;t);\n13:   }\n14: \n15:   return 0;\n16: }\n\/* end *\/\n\n--------------------\n\nhave_func: checking for rb_wait_for_single_fd()... -------------------- yes\n\n\"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  \"\nconftest.c: In function 't':\nconftest.c:8:57: error: 'rb_wait_for_single_fd' undeclared (first use in this function)\nconftest.c:8:57: note: each undeclared identifier is reported only once for each function it appears in\nconftest.c:8:32: warning: variable 'p' set but not used [-Wunused-but-set-variable]\nchecked program was:\n\/* begin *\/\n 1: #include \"ruby.h\"\n 2: \n 3: #include \n 4: #include \n 5: \n 6: \/*top*\/\n 7: extern int t(void);\n 8: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_wait_for_single_fd; return 0; }\n 9: int main(int argc, char **argv)\n10: {\n11:   if (argc &gt; 1000000) {\n12:     printf(\"%p\", &amp;t);\n13:   }\n14: \n15:   return 0;\n16: }\n\/* end *\/\n\n\"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  \"\nconftest.c: In function 't':\nconftest.c:8:1: warning: implicit declaration of function 'rb_wait_for_single_fd' [-Wimplicit-function-declaration]\nchecked program was:\n\/* begin *\/\n 1: #include \"ruby.h\"\n 2: \n 3: #include \n 4: #include \n 5: \n 6: \/*top*\/\n 7: extern int t(void);\n 8: int t(void) { rb_wait_for_single_fd(); return 0; }\n 9: int main(int argc, char **argv)\n10: {\n11:   if (argc &gt; 1000000) {\n12:     printf(\"%p\", &amp;t);\n13:   }\n14: \n15:   return 0;\n16: }\n\/* end *\/\n\n--------------------\n\nhave_func: checking for rb_hash_dup()... -------------------- yes\n\n\"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  \"\nconftest.c: In function 't':\nconftest.c:8:32: warning: variable 'p' set but not used [-Wunused-but-set-variable]\nchecked program was:\n\/* begin *\/\n 1: #include \"ruby.h\"\n 2: \n 3: #include \n 4: #include \n 5: \n 6: \/*top*\/\n 7: extern int t(void);\n 8: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_hash_dup; return 0; }\n 9: int main(int argc, char **argv)\n10: {\n11:   if (argc &gt; 1000000) {\n12:     printf(\"%p\", &amp;t);\n13:   }\n14: \n15:   return 0;\n16: }\n\/* end *\/\n\n--------------------\n\nhave_func: checking for rb_intern3()... -------------------- yes\n\n\"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  \"\nconftest.c: In function 't':\nconftest.c:8:57: error: 'rb_intern3' undeclared (first use in this function)\nconftest.c:8:57: note: each undeclared identifier is reported only once for each function it appears in\nconftest.c:8:32: warning: variable 'p' set but not used [-Wunused-but-set-variable]\nchecked program was:\n\/* begin *\/\n 1: #include \"ruby.h\"\n 2: \n 3: #include \n 4: #include \n 5: \n 6: \/*top*\/\n 7: extern int t(void);\n 8: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_intern3; return 0; }\n 9: int main(int argc, char **argv)\n10: {\n11:   if (argc &gt; 1000000) {\n12:     printf(\"%p\", &amp;t);\n13:   }\n14: \n15:   return 0;\n16: }\n\/* end *\/\n\n\"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  \"\nconftest.c: In function 't':\nconftest.c:8:1: warning: implicit declaration of function 'rb_intern3' [-Wimplicit-function-declaration]\nchecked program was:\n\/* begin *\/\n 1: #include \"ruby.h\"\n 2: \n 3: #include \n 4: #include \n 5: \n 6: \/*top*\/\n 7: extern int t(void);\n 8: int t(void) { rb_intern3(); return 0; }\n 9: int main(int argc, char **argv)\n10: {\n11:   if (argc &gt; 1000000) {\n12:     printf(\"%p\", &amp;t);\n13:   }\n14: \n15:   return 0;\n16: }\n\/* end *\/\n\n--------------------\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m completely new to rails development and have been struggling with installing mysql2 with the past month. I&#8217;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&gt;gem install mysql2 &#8211;platform=ruby &#8212; &#8216;&#8211;with-mysql-dir=&#8221;C:\\mysql-connector\\&#8221;&#8216; &#8211;with-mysql lib=&#8221;C:\\mysql-connector\\lib&#8221;&#8216; Temporarily enhancing PATH [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7363","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7363","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7363"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7363\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}