疯狂的宝石和捆绑麻烦

时间:2014-02-04 15:17:54

标签: ruby-on-rails gem rubymine

我正在开发一个共享的Rails项目,并且在我的电脑上安装它时遇到了一些麻烦。我在RubyMine中打开了项目并得到了这样的输出错误:

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        C:/Ruby193/bin/ruby.exe extconf.rb 
checking for CLOCK_MONOTONIC in time.h... no
checking for CLOCK_MONOTONIC() in time.h... no
checking for clockid_t in time.h... no
checking for clock_gettime() in -lrt... no
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for poll() in poll.h... no
checking for getaddrinfo() in sys/types.h,sys/socket.h,netdb.h... no
getaddrinfo required
*** 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:/Ruby193/bin/ruby
    --with-rtlib
    --without-rtlib
    --with-nsllib
    --without-nsllib
    --with-socketlib
    --without-socketlib


Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/kgio-2.7.4 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/kgio-2.7.4/ext/kgio/gem_make.out
An error occurred while installing kgio (2.7.4), and Bundler cannot continue.
Make sure that `gem install kgio -v '2.7.4'` succeeds before bundling.

当我尝试运行服务器时,他抱怨没有安装一些宝石。最烦人的是他不想安装这些宝石(见上文)。

是否有人知道可以帮助我的事情?

提前致谢...

编辑:mkmf.log

have_macro: checking for CLOCK_MONOTONIC in time.h... -------------------- no

"gcc -o conftest -IC:/Ruby193/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby193/include/ruby-1.9.1/ruby/backward -IC:/Ruby193/include/ruby-1.9.1 -I. -DFD_SETSIZE=2048  -DFD_SETSIZE=2048 -D_GNU_SOURCE -DPOSIX_C_SOURCE=1-D_POSIX_C_SOURCE=200112L  -O3 -fno-omit-frame-pointer -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c  -L. -LC:/Ruby193/lib -L.      -lmsvcrt-ruby191  -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 */

"gcc -IC:/Ruby193/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby193/include/ruby-1.9.1/ruby/backward -IC:/Ruby193/include/ruby-1.9.1 -I. -DFD_SETSIZE=2048  -DFD_SETSIZE=2048 -D_GNU_SOURCE -DPOSIX_C_SOURCE=1-D_POSIX_C_SOURCE=200112L  -O3 -fno-omit-frame-pointer -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration   -c conftest.c"
conftest.c:8:3: error: #error 
conftest.c:9:1: error: expected identifier or '(' before '>>' token
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: #include <time.h>
 6: /*top*/
 7: #ifndef CLOCK_MONOTONIC
 8: # error
 9: >>>>>> CLOCK_MONOTONIC undefined <<<<<<
10: #endif
/* end */

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

have_func: checking for CLOCK_MONOTONIC() in time.h... -------------------- no

"gcc -o conftest -IC:/Ruby193/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby193/include/ruby-1.9.1/ruby/backward -IC:/Ruby193/include/ruby-1.9.1 -I. -DFD_SETSIZE=2048  -DFD_SETSIZE=2048 -D_GNU_SOURCE -DPOSIX_C_SOURCE=1-D_POSIX_C_SOURCE=200112L  -O3 -fno-omit-frame-pointer -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c  -L. -LC:/Ruby193/lib -L.      -lmsvcrt-ruby191  -lshell32 -lws2_32 -limagehlp -lshlwapi  "
conftest.c: In function 't':
conftest.c:8:53: error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
conftest.c:8:53: 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: #include <time.h>
 6: 
 7: /*top*/
 8: int t() { void ((*volatile p)()); p = (void ((*)()))CLOCK_MONOTONIC; 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 */

"gcc -o conftest -IC:/Ruby193/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby193/include/ruby-1.9.1/ruby/backward -IC:/Ruby193/include/ruby-1.9.1 -I. -DFD_SETSIZE=2048  -DFD_SETSIZE=2048 -D_GNU_SOURCE -DPOSIX_C_SOURCE=1-D_POSIX_C_SOURCE=200112L  -O3 -fno-omit-frame-pointer -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c  -L. -LC:/Ruby193/lib -L.      -lmsvcrt-ruby191  -lshell32 -lws2_32 -limagehlp -lshlwapi  "
conftest.c: In function 't':
conftest.c:8:1: warning: implicit declaration of function 'CLOCK_MONOTONIC'
C:\Users\Jakob\AppData\Local\Temp\ccoSUpHu.o: In function `t':
C:\Ruby193\lib\ruby\gems\1.9.1\gems\kgio-2.7.4\ext\kgio/conftest.c:8: undefined reference to `CLOCK_MONOTONIC'
collect2: ld returned 1 exit status
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: #include <time.h>
 6: 
 7: /*top*/
 8: int t() { CLOCK_MONOTONIC(); 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_type: checking for clockid_t in time.h... -------------------- no

"gcc -IC:/Ruby193/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby193/include/ruby-1.9.1/ruby/backward -IC:/Ruby193/include/ruby-1.9.1 -I. -DFD_SETSIZE=2048  -DFD_SETSIZE=2048 -D_GNU_SOURCE -DPOSIX_C_SOURCE=1-D_POSIX_C_SOURCE=200112L  -O3 -fno-omit-frame-pointer -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration   -c conftest.c"
conftest.c:8:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'conftest_type'
conftest.c:9:24: error: 'conftest_type' undeclared here (not in a function)
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <time.h>
6: 
7: /*top*/
8: typedef clockid_t conftest_type;
9: int conftestval[sizeof(conftest_type)?1:-1];
/* end */

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

have_library: checking for clock_gettime() in -lrt... -------------------- no

"gcc -o conftest -IC:/Ruby193/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby193/include/ruby-1.9.1/ruby/backward -IC:/Ruby193/include/ruby-1.9.1 -I. -DFD_SETSIZE=2048  -DFD_SETSIZE=2048 -D_GNU_SOURCE -DPOSIX_C_SOURCE=1-D_POSIX_C_SOURCE=200112L  -O3 -fno-omit-frame-pointer -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c  -L. -LC:/Ruby193/lib -L.      -lmsvcrt-ruby191 -lrt  -lshell32 -lws2_32 -limagehlp -lshlwapi  "
conftest.c: In function 't':
conftest.c:8:53: error: 'clock_gettime' undeclared (first use in this function)
conftest.c:8:53: 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: #include <time.h>
 6: 
 7: /*top*/
 8: int t() { void ((*volatile p)()); p = (void ((*)()))clock_gettime; 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 */

"gcc -o conftest -IC:/Ruby193/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby193/include/ruby-1.9.1/ruby/backward -IC:/Ruby193/include/ruby-1.9.1 -I. -DFD_SETSIZE=2048  -DFD_SETSIZE=2048 -D_GNU_SOURCE -DPOSIX_C_SOURCE=1-D_POSIX_C_SOURCE=200112L  -O3 -fno-omit-frame-pointer -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c  -L. -LC:/Ruby193/lib -L.      -lmsvcrt-ruby191 -lrt  -lshell32 -lws2_32 -limagehlp -lshlwapi  "
conftest.c: In function 't':
conftest.c:8:1: warning: implicit declaration of function 'clock_gettime'
c:/ruby193/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lrt
collect2: ld returned 1 exit status
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: #include <time.h>
 6: 
 7: /*top*/
 8: int t() { clock_gettime(); 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_library: checking for t_open() in -lnsl... -------------------- no

"gcc -o conftest -IC:/Ruby193/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby193/include/ruby-1.9.1/ruby/backward -IC:/Ruby193/include/ruby-1.9.1 -I. -DFD_SETSIZE=2048  -DFD_SETSIZE=2048 -D_GNU_SOURCE -DPOSIX_C_SOURCE=1-D_POSIX_C_SOURCE=200112L  -O3 -fno-omit-frame-pointer -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c  -L. -LC:/Ruby193/lib -L.      -lmsvcrt-ruby191 -lnsl  -lshell32 -lws2_32 -limagehlp -lshlwapi  "
conftest.c: In function 't':
conftest.c:7:53: error: 't_open' undeclared (first use in this function)
conftest.c:7:53: 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: int t() { void ((*volatile p)()); p = (void ((*)()))t_open; return 0; }
 8: int main(int argc, char **argv)
 9: {
10:   if (argc > 1000000) {
11:     printf("%p", &t);
12:   }
13: 
14:   return 0;
15: }
/* end */

"gcc -o conftest -IC:/Ruby193/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby193/include/ruby-1.9.1/ruby/backward -IC:/Ruby193/include/ruby-1.9.1 -I. -DFD_SETSIZE=2048  -DFD_SETSIZE=2048 -D_GNU_SOURCE -DPOSIX_C_SOURCE=1-D_POSIX_C_SOURCE=200112L  -O3 -fno-omit-frame-pointer -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c  -L. -LC:/Ruby193/lib -L.      -lmsvcrt-ruby191 -lnsl  -lshell32 -lws2_32 -limagehlp -lshlwapi  "
conftest.c: In function 't':
conftest.c:7:1: warning: implicit declaration of function 't_open'
c:/ruby193/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lnsl
collect2: 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: int t() { t_open(); return 0; }
 8: int main(int argc, char **argv)
 9: {
10:   if (argc > 1000000) {
11:     printf("%p", &t);
12:   }
13: 
14:   return 0;
15: }
/* end */

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

have_library: checking for socket() in -lsocket... -------------------- no

"gcc -o conftest -IC:/Ruby193/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby193/include/ruby-1.9.1/ruby/backward -IC:/Ruby193/include/ruby-1.9.1 -I. -DFD_SETSIZE=2048  -DFD_SETSIZE=2048 -D_GNU_SOURCE -DPOSIX_C_SOURCE=1-D_POSIX_C_SOURCE=200112L  -O3 -fno-omit-frame-pointer -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c  -L. -LC:/Ruby193/lib -L.      -lmsvcrt-ruby191 -lsocket  -lshell32 -lws2_32 -limagehlp -lshlwapi  "
c:/ruby193/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lsocket
collect2: 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: int t() { void ((*volatile p)()); p = (void ((*)()))socket; return 0; }
 8: int main(int argc, char **argv)
 9: {
10:   if (argc > 1000000) {
11:     printf("%p", &t);
12:   }
13: 
14:   return 0;
15: }
/* end */

"gcc -o conftest -IC:/Ruby193/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby193/include/ruby-1.9.1/ruby/backward -IC:/Ruby193/include/ruby-1.9.1 -I. -DFD_SETSIZE=2048  -DFD_SETSIZE=2048 -D_GNU_SOURCE -DPOSIX_C_SOURCE=1-D_POSIX_C_SOURCE=200112L  -O3 -fno-omit-frame-pointer -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c  -L. -LC:/Ruby193/lib -L.      -lmsvcrt-ruby191 -lsocket  -lshell32 -lws2_32 -limagehlp -lshlwapi  "
conftest.c: In function 't':
conftest.c:7:1: error: too few arguments to function 'socket'
c:\ruby193\devkit\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winsock2.h:553:35: note: declared here
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: 
 6: /*top*/
 7: int t() { socket(); return 0; }
 8: int main(int argc, char **argv)
 9: {
10:   if (argc > 1000000) {
11:     printf("%p", &t);
12:   }
13: 
14:   return 0;
15: }
/* end */

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

have_func: checking for poll() in poll.h... -------------------- no

"gcc -o conftest -IC:/Ruby193/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby193/include/ruby-1.9.1/ruby/backward -IC:/Ruby193/include/ruby-1.9.1 -I. -DFD_SETSIZE=2048  -DFD_SETSIZE=2048 -D_GNU_SOURCE -DPOSIX_C_SOURCE=1-D_POSIX_C_SOURCE=200112L  -O3 -fno-omit-frame-pointer -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c  -L. -LC:/Ruby193/lib -L.      -lmsvcrt-ruby191  -lshell32 -lws2_32 -limagehlp -lshlwapi  "
conftest.c:5:18: fatal error: poll.h: No such file or directory
compilation terminated.
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: #include <poll.h>
 6: 
 7: /*top*/
 8: int t() { void ((*volatile p)()); p = (void ((*)()))poll; 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 */

"gcc -o conftest -IC:/Ruby193/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby193/include/ruby-1.9.1/ruby/backward -IC:/Ruby193/include/ruby-1.9.1 -I. -DFD_SETSIZE=2048  -DFD_SETSIZE=2048 -D_GNU_SOURCE -DPOSIX_C_SOURCE=1-D_POSIX_C_SOURCE=200112L  -O3 -fno-omit-frame-pointer -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c  -L. -LC:/Ruby193/lib -L.      -lmsvcrt-ruby191  -lshell32 -lws2_32 -limagehlp -lshlwapi  "
conftest.c:5:18: fatal error: poll.h: No such file or directory
compilation terminated.
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: #include <poll.h>
 6: 
 7: /*top*/
 8: int t() { poll(); 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 getaddrinfo() in sys/types.h,sys/socket.h,netdb.h... -------------------- no

"gcc -o conftest -IC:/Ruby193/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby193/include/ruby-1.9.1/ruby/backward -IC:/Ruby193/include/ruby-1.9.1 -I. -DFD_SETSIZE=2048  -DFD_SETSIZE=2048 -D_GNU_SOURCE -DPOSIX_C_SOURCE=1-D_POSIX_C_SOURCE=200112L  -O3 -fno-omit-frame-pointer -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c  -L. -LC:/Ruby193/lib -L.      -lmsvcrt-ruby191  -lshell32 -lws2_32 -limagehlp -lshlwapi  "
conftest.c:6:24: fatal error: sys/socket.h: No such file or directory
compilation terminated.
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: #include <sys/types.h>
 6: #include <sys/socket.h>
 7: #include <netdb.h>
 8: 
 9: /*top*/
10: int t() { void ((*volatile p)()); p = (void ((*)()))getaddrinfo; return 0; }
11: int main(int argc, char **argv)
12: {
13:   if (argc > 1000000) {
14:     printf("%p", &t);
15:   }
16: 
17:   return 0;
18: }
/* end */

"gcc -o conftest -IC:/Ruby193/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby193/include/ruby-1.9.1/ruby/backward -IC:/Ruby193/include/ruby-1.9.1 -I. -DFD_SETSIZE=2048  -DFD_SETSIZE=2048 -D_GNU_SOURCE -DPOSIX_C_SOURCE=1-D_POSIX_C_SOURCE=200112L  -O3 -fno-omit-frame-pointer -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c  -L. -LC:/Ruby193/lib -L.      -lmsvcrt-ruby191  -lshell32 -lws2_32 -limagehlp -lshlwapi  "
conftest.c:6:24: fatal error: sys/socket.h: No such file or directory
compilation terminated.
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: #include <sys/types.h>
 6: #include <sys/socket.h>
 7: #include <netdb.h>
 8: 
 9: /*top*/
10: int t() { getaddrinfo(); return 0; }
11: int main(int argc, char **argv)
12: {
13:   if (argc > 1000000) {
14:     printf("%p", &t);
15:   }
16: 
17:   return 0;
18: }
/* end */

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

1 个答案:

答案 0 :(得分:0)

好吧,我找到了解决这个问题的方法。问题是某些宝石在Windows环境中不起作用。因此,只需在Linux服务器上运行项目就可以解决这个问题......