Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在windows上用ruby编译openssl_Windows_Ruby_Openssl_Compiler Errors - Fatal编程技术网

在windows上用ruby编译openssl

在windows上用ruby编译openssl,windows,ruby,openssl,compiler-errors,Windows,Ruby,Openssl,Compiler Errors,我正试图用我的ruby配置在带有MingW的windows计算机上编译openssl 我使用以下命令运行ruby 1.9.2rc2: $ ruby extconf.rb --with-openssl-dir=/c/openssl ... ... ... === Checking done. === creating extconf.h creating Makefile Done. 这样做没有任何错误。 当我尝试制作时: $ make gcc -I. -Ic:/Ruby192/include/

我正试图用我的ruby配置在带有MingW的windows计算机上编译openssl

我使用以下命令运行ruby 1.9.2rc2:

$ ruby extconf.rb --with-openssl-dir=/c/openssl
...
...
...
=== Checking done. ===
creating extconf.h
creating Makefile
Done.
这样做没有任何错误。 当我尝试
制作
时:

$ make
gcc -I. -Ic:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/c/Ruby192/include/ruby-1
.9.1/ruby/backward -I/c/Ruby192/include/ruby-1.9.1 -I. -DRUBY_EXTCONF_H=\"extcon
f.h\" -Ic:/openssl/include    -O3 -g -Wall -Wno-unused-parameter -Wno-parenthese
s -Wpointer-arith -Wwrite-strings -Wno-long-long  -o openssl_missing.o -c openss
l_missing.c
In file included from openssl_missing.c:22:
openssl_missing.h:71: error: conflicting types for 'HMAC_CTX_copy'
c:/openssl/include/openssl/hmac.h:102: error: previous declaration of 'HMAC_CTX_
copy' was here
openssl_missing.h:71: error: conflicting types for 'HMAC_CTX_copy'
c:/openssl/include/openssl/hmac.h:102: error: previous declaration of 'HMAC_CTX_
copy' was here
openssl_missing.h:95: error: conflicting types for 'EVP_CIPHER_CTX_copy'
c:/openssl/include/openssl/evp.h:459: error: previous declaration of 'EVP_CIPHER
_CTX_copy' was here
openssl_missing.h:95: error: conflicting types for 'EVP_CIPHER_CTX_copy'
c:/openssl/include/openssl/evp.h:459: error: previous declaration of 'EVP_CIPHER
_CTX_copy' was here
make: *** [openssl_missing.o] Error 1

这里有一些错误。我确实知道错误在说什么,但我无法理解或解决它。

我可以问你为什么要编译openssl扩展吗

它是Ruby本身的一部分,使用正确的OpenSSL版本应该可以正确编译

从您正在工作的目录中得到的提示,似乎您正在使用基于RubyInstaller的安装程序,或者可能正在尝试从头开始工作

如果是从头开始的,我建议您研究一个在GitHub上提供编译配方存储库的项目:


希望能有所帮助。

我已经从svn编译了Ruby 1.9.2,因为1.9.2没有rubyinstaller。那么你认为我应该使用哪种openssl呢?有,但不是rc2,因为gem_prelude中引入了一个bug。您可以克隆存储库,更改rc2的配置,并根据需要自行构建。忘了提一下:相信我,是最简单的方法。现在我已经将openssl版本改为0.9.8,现在我没有收到这些错误,而是收到了以下错误:
ossl_ssl.o:In function ssl_servername_cb:c:/ruby192rc2/ext/openssl/ossl_ssl.c:495:对ossl_get_servername的未定义引用
请克隆存储库,将版本更改为rc2并使用它,或者浪费时间让每一个分机都能正常工作。相信我,这需要很多时间,而OpenSSL是最糟糕的。