我已经尝试了几天来为ruby安装puma gem(2.1.5)。我已经更新了rubygems,我安装并成功运行了devkit,下载了最新的ssl头文件并将它们送到安装但是都没有成功 这个解决方案已经选择了,我已经看到了其他几个来自Luis Lavena或来自http://rubygems.org而不是https://,但它们似乎都不适合我:
https://github.com/hicknhack-software/rails-disco/wiki/Installing-puma-on-windows
我一直收到这个错误:
$ gem install puma -v 2.9.2 -- --with-opt-dir=c:\openssl
Temporarily enhancing PATH to include DevKit...
Building native extensions with: '--with-opt-dir=c:openssl'
This could take a while...
ERROR: Error installing puma:
ERROR: Failed to build gem native extension.
c:/Ruby21-x64/bin/ruby.exe -r ./siteconf20150126-4428-1lhbkfi.rb extconf.rb
--with-opt-dir=c:openssl
checking for SSL_CTX_new() in -lssl... no
checking for SSL_CTX_new() in -lssleay32... no
*** 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
--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:/Ruby21-x64/bin/ruby
--with-puma_http11-dir
--without-puma_http11-dir
--with-puma_http11-include
--without-puma_http11-include=${puma_http11-dir}/include
--with-puma_http11-lib
--without-puma_http11-lib=${puma_http11-dir}/lib
--with-ssllib
--without-ssllib
--with-ssleay32lib
--without-ssleay32lib
extconf failed, exit code 1
Gem files will remain installed in c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/puma-2
.9.2 for inspection.
Results logged to c:/Ruby21-x64/lib/ruby/gems/2.1.0/extensions/x64-mingw32/2.1.0
/puma-2.9.2/gem_make.out
我的日志文件:
have_library: checking for SSL_CTX_new() in -lssl... -------------------- no
"x86_64-w64-mingw32-gcc -o conftest.exe -Ic:/Ruby21-x64/include/ruby-2.1.0/x64-mingw32 -Ic:/Ruby21-x64/include/ruby-2.1.0/ruby/backward -Ic:/Ruby21-x64/include/ruby-2.1.0 -I. -Ic:openssl/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -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:/Ruby21-x64/lib -Lc:openssl/lib -L. -lx64-msvcrt-ruby210 -lshell32 -lws2_32 -liphlpapi -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 -o conftest.exe -Ic:/Ruby21-x64/include/ruby-2.1.0/x64-mingw32 -Ic:/Ruby21-x64/include/ruby-2.1.0/ruby/backward -Ic:/Ruby21-x64/include/ruby-2.1.0 -I. -Ic:openssl/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -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:/Ruby21-x64/lib -Lc:openssl/lib -L. -lx64-msvcrt-ruby210 -lssl -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:16:57: error: 'SSL_CTX_new' undeclared (first use in this function)
conftest.c:16:57: note: each undeclared identifier is reported only once for each function it appears in
conftest.c:16: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 main(int argc, char **argv)
9: {
10: if (argc > 1000000) {
11: printf("%p", &t);
12: }
13:
14: return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))SSL_CTX_new; return 0; }
/* end */
"x86_64-w64-mingw32-gcc -o conftest.exe -Ic:/Ruby21-x64/include/ruby-2.1.0/x64-mingw32 -Ic:/Ruby21-x64/include/ruby-2.1.0/ruby/backward -Ic:/Ruby21-x64/include/ruby-2.1.0 -I. -Ic:openssl/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -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:/Ruby21-x64/lib -Lc:openssl/lib -L. -lx64-msvcrt-ruby210 -lssl -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:16:1: warning: implicit declaration of function 'SSL_CTX_new' [-Wimplicit-function-declaration]
c:/devkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lssl
collect2.exe: error: 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: extern int t(void);
8: int main(int argc, char **argv)
9: {
10: if (argc > 1000000) {
11: printf("%p", &t);
12: }
13:
14: return 0;
15: }
16: int t(void) { SSL_CTX_new(); return 0; }
/* end */
--------------------
have_library: checking for SSL_CTX_new() in -lssleay32... -------------------- no
"x86_64-w64-mingw32-gcc -o conftest.exe -Ic:/Ruby21-x64/include/ruby-2.1.0/x64-mingw32 -Ic:/Ruby21-x64/include/ruby-2.1.0/ruby/backward -Ic:/Ruby21-x64/include/ruby-2.1.0 -I. -Ic:openssl/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -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:/Ruby21-x64/lib -Lc:openssl/lib -L. -lx64-msvcrt-ruby210 -lssleay32 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:16:57: error: 'SSL_CTX_new' undeclared (first use in this function)
conftest.c:16:57: note: each undeclared identifier is reported only once for each function it appears in
conftest.c:16: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 main(int argc, char **argv)
9: {
10: if (argc > 1000000) {
11: printf("%p", &t);
12: }
13:
14: return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))SSL_CTX_new; return 0; }
/* end */
"x86_64-w64-mingw32-gcc -o conftest.exe -Ic:/Ruby21-x64/include/ruby-2.1.0/x64-mingw32 -Ic:/Ruby21-x64/include/ruby-2.1.0/ruby/backward -Ic:/Ruby21-x64/include/ruby-2.1.0 -I. -Ic:openssl/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -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:/Ruby21-x64/lib -Lc:openssl/lib -L. -lx64-msvcrt-ruby210 -lssleay32 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:16:1: warning: implicit declaration of function 'SSL_CTX_new' [-Wimplicit-function-declaration]
c:/devkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lssleay32
collect2.exe: error: 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: extern int t(void);
8: int main(int argc, char **argv)
9: {
10: if (argc > 1000000) {
11: printf("%p", &t);
12: }
13:
14: return 0;
15: }
16: int t(void) { SSL_CTX_new(); return 0; }
/* end */
--------------------
gem_make.out文件:
c:/Ruby21-x64/bin/ruby.exe -r ./siteconf20150126-4428-1lhbkfi.rb extconf.rb --with-opt-dir=c:openssl
checking for SSL_CTX_new() in -lssl... no
checking for SSL_CTX_new() in -lssleay32... no
*** 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
--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:/Ruby21-x64/bin/ruby
--with-puma_http11-dir
--without-puma_http11-dir
--with-puma_http11-include
--without-puma_http11-include=${puma_http11-dir}/include
--with-puma_http11-lib
--without-puma_http11-lib=${puma_http11-dir}/lib
--with-ssllib
--without-ssllib
--with-ssleay32lib
--without-ssleay32lib
extconf failed, exit code 1
答案 0 :(得分:-1)
您提供了32位ruby链接的说明(至少指向openssl库的链接中包含x86),而看起来您使用的是64位版本。
有一种方法可以检查您的ruby安装所使用的openssl的确切版本,如Google Groups for RubyInstaller thread named Updated OpenSSL Knapsack packages (x86 and x64)所述
> ruby -v -ropenssl -e "puts OpenSSL::OPENSSL_VERSION"
ruby 2.1.5p273 (2014-11-13 revision 48405) [x64-mingw32]
OpenSSL 1.0.0o 15 Oct 2014
所以在我的情况下,方法是https://bintray.com/oneclick/OpenKnapsack/openssl/view希望有相应的版本。