2010-07-14 92 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