2010-07-14 64 views
2

我想用MingW在windows计算机上编译openssl和我的ruby配置。在windows上编译openssl和ruby

我运行红宝石1.9.2rc2这些命令:

$ ruby extconf.rb --with-openssl-dir=/c/openssl 
... 
... 
... 
=== Checking done. === 
creating extconf.h 
creating Makefile 
Done. 

,没有任何错误的工作。 当我尝试make

$ 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 

在这里,我得到了一些错误。我明白错误在说什么,但我无法理解或解决它。

回答

3

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

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

从你工作的目录提示,似乎你使用基于RubyInstaller的安装程序,或者尝试从头开始工作?

如果是从头开始,我建议你看看RubyInstaller项目,提供位于GitHub上编制食谱库:

http://github.com/oneclick/rubyinstaller/

希望有所帮助。

+0

我从svn编译了Ruby 1.9.2,因为1.9.2没有rubyinstaller。你认为我应该用哪个openssl? – Lisinge 2010-07-14 21:21:31

+0

由于gem_prelude中引入了一个错误,因此存在但不适用于rc2。您可以克隆存储库,更改rc2的配置并根据需要自行构建。 – 2010-07-14 22:24:35

+0

忘了提:相信我,是最简单的道路。 – 2010-07-14 22:24:51