我对rails开发完全不熟悉,并且在过去一个月里一直在努力安装mysql2。我有Windows 8.1 64位,ruby 2.0.0p535 64位,rails 4.0.2,我有mysql2(0.3.14)64位。我从cmd得到的错误在下面。
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 <winsock2.h>
4: #include <windows.h>
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 <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
"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 <winsock2.h>
4: #include <windows.h>
5: #include <ruby/thread.h>
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 <winsock2.h>
4: #include <windows.h>
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 <winsock2.h>
4: #include <windows.h>
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 <winsock2.h>
4: #include <windows.h>
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 <winsock2.h>
4: #include <windows.h>
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 <winsock2.h>
4: #include <windows.h>
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 <winsock2.h>
4: #include <windows.h>
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 */
--------------------
答案 0 :(得分:0)
C:\Users\tghol_000>gem install mysql2 --platform=ruby -- '--with-mysql-dir="C:\mysql-connector\"' --with-mysql lib="C:\mysql-connector\lib"'
^-- remove that '
你有不必要的撇号,我检查了它的位置,删除并重试。