gpt4 book ai didi

mysql - 我怎样才能安装mysql2?

转载 作者:行者123 更新时间:2023-11-30 00:51:14 29 4
gpt4 key购买 nike

我对 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}/libC:/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 1Gem 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 */

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

最佳答案

C:\Users\tghol_000>gem install mysql2 --platform=ruby -- '--with-mysql-dir="C:\mysql-connector\"' --with-mysql         lib="C:\mysql-connector\lib"'
^-- remove that '

您有不必要的撇号,我已经检查了它在哪里,删除并重试。

关于mysql - 我怎样才能安装mysql2?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20950497/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com