无法在 Windows 8.1 (ruby 2.1.5) 上安装 Puma gem [英] Can't install Puma gem on windows 8.1 (ruby 2.1.5)

查看:62
本文介绍了无法在 Windows 8.1 (ruby 2.1.5) 上安装 Puma gem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试了几天来为 ruby​​ (2.1.5) 安装 puma gem.我已经更新了 ruby​​gems,我安装并成功运行了 devkit,下载了最新的 ssl 标头并将它们提供给安装,但都没有成功已选择此解决方案,我已经看到其他几个来自 Luis Lavena 或从 http://rubygems.org 采购的解决方案https://但似乎没有一个真正适合我:

I've been trying for a few days now to install the puma gem for ruby (2.1.5). I've update rubygems, I installed and succesfully ran the devkit, downloaded the latest ssl headers and fed them to the installation but all without success This solution has been opted and I've seen several other ones from Luis Lavena or sourcing from http://rubygems.org instead of https:// but none of them seem to really work for me:

https://github.com/hicknhack-软件/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 文件:

The gem_make.out file:

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

推荐答案

您提供链接的说明适用于 32 位 ruby​​(至少 openssl 库的链接中包含 x86),而看起来您使用的是 64位版本.

Instructions you provided the link for are for 32 bit ruby (at least the link to openssl library has x86 in it), while it looks like you are using 64 bit version.

有一种方法可以检查您的 ruby​​ 安装使用的 openssl 的确切版本,如 Google Groups for RubyInstaller 线程名为更新的 OpenSSL Knapsack 包(x86 和 x64)

There is a way to check exact version of openssl used by your ruby installation as mentioned on 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 希望有对应的版本.

So in my case the way to go is https://bintray.com/oneclick/OpenKnapsack/openssl/view hoping that there is corresponding version.

这篇关于无法在 Windows 8.1 (ruby 2.1.5) 上安装 Puma gem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆