2016-11-09 36 views
1

我使用rvm來安裝Ruby,但我有一個我不明白的錯誤。這是我在控制檯得到編制的中間位置:無法構建紅寶石2.2.2 - 未聲明的各種SSLv3_方法

derby git:(master) rvm install ruby-2.2.2 
ruby-2.2.2 - #removing src/ruby-2.2.2 - please wait 
Searching for binary rubies, this might take some time. 
No binary rubies available for: ubuntu/16.04/x86_64/ruby-2.2.2. 
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies. 
Checking requirements for ubuntu. 
Requirements installation successful. 
Installing Ruby from source to: /usr/share/rvm/rubies/ruby-2.2.2, this may take a while depending on your cpu(s)... 
ruby-2.2.2 - #downloading ruby-2.2.2, this may take a while depending on your connection... 
ruby-2.2.2 - #extracting ruby-2.2.2 to /usr/share/rvm/src/ruby-2.2.2 - please wait 
ruby-2.2.2 - #applying patch /usr/share/rvm/patches/ruby/2.2.2/fix_installing_bundled_gems.patch - please wait 
ruby-2.2.2 - #configuring - please wait 
ruby-2.2.2 - #post-configuration - please wait 
ruby-2.2.2 - #compiling - please wait 
Error running '__rvm_make -j8', 
showing last 15 lines of /home/krex/.rvm/log/1478709580_ruby-2.2.2/make.log 
compiling constants.c 
make[2]: Leaving directory '/usr/share/rvm/src/ruby-2.2.2/ext/openssl' 
exts.mk:202: recipe for target 'ext/openssl/all' failed 
make[1]: *** [ext/openssl/all] Error 2 
make[1]: *** Waiting for unfinished jobs.... 
linking shared-object zlib.so 
make[2]: Leaving directory '/usr/share/rvm/src/ruby-2.2.2/ext/zlib' 
linking shared-object socket.so 
make[2]: Leaving directory '/usr/share/rvm/src/ruby-2.2.2/ext/socket' 
linking shared-object ripper.so 
make[2]: Leaving directory '/usr/share/rvm/src/ruby-2.2.2/ext/ripper' 
make[1]: Leaving directory '/usr/share/rvm/src/ruby-2.2.2' 
uncommon.mk:189: recipe for target 'build-ext' failed 
make: *** [build-ext] Error 2 
+__rvm_make:0> return 2 
There has been an error while running make. Halting the installation. 

OpenSSL的版本,我已經是:OpenSSL 1.0.2j 26 Sep 2016

log file /home/krex/.rvm/log/1478709580_ruby-2.2.2/make.log包含該編譯錯誤:

compiling ossl_x509cert.c 
ossl_ssl.c:141:27: error: ‘SSLv3_method’ undeclared here (not in a function) 
    OSSL_SSL_METHOD_ENTRY(SSLv3), 
         ^
ossl_ssl.c:119:69: note: in definition of macro ‘OSSL_SSL_METHOD_ENTRY’ 
#define OSSL_SSL_METHOD_ENTRY(name) { #name, (SSL_METHOD *(*)(void))name##_method } 
                    ^
ossl_ssl.c:142:27: error: ‘SSLv3_server_method’ undeclared here (not in a function) 
    OSSL_SSL_METHOD_ENTRY(SSLv3_server), 
         ^
ossl_ssl.c:119:69: note: in definition of macro ‘OSSL_SSL_METHOD_ENTRY’ 
#define OSSL_SSL_METHOD_ENTRY(name) { #name, (SSL_METHOD *(*)(void))name##_method } 
                    ^
ossl_ssl.c:143:27: error: ‘SSLv3_client_method’ undeclared here (not in a function) 
    OSSL_SSL_METHOD_ENTRY(SSLv3_client), 
         ^
ossl_ssl.c:119:69: note: in definition of macro ‘OSSL_SSL_METHOD_ENTRY’ 
#define OSSL_SSL_METHOD_ENTRY(name) { #name, (SSL_METHOD *(*)(void))name##_method } 
                    ^
Makefile:293: recipe for target 'ossl_ssl.o' failed 
make[2]: *** [ossl_ssl.o] Error 1 

我嘗試從這個問題的解決方案,但這也沒有幫助: Rbenv ruby 2.2.2 install fail Ubuntu 14.04

如何d o我解決了這個錯誤並安裝了Ruby?

+0

我猜安裝'的libssl-dev'將帶你一步;) 你見過這樣的: '的https:// rvm.io/RVM/autolibs' 你可能想爲 運行命令'RVM安裝Ruby-2.2.2 --autolibs = enable' 甚至對良好的autolibs: 'RVM autolibs enable' – kaczor1984

+0

嗨,我試圖與安裝' sudo apt install libssl-dev',但是我得到這個:'libssl-dev已經是最新版本(1.0.2j-1 + deb.sury.org〜xenial + 1)'我也嘗試過使用autolibs啓用,但是錯誤是相同... –

+0

非常感謝你@Wayne偉大的編輯,這更清晰! –

回答

2

rbenv發現類似問題:Cannot install Ruby 2.2.3 in ubuntu 14.04

當使用特定版本的openssl構建時,這似乎是Ruby 2.2.2和2.2.3的問題。如果可以,請更改爲更高版本的Ruby 2.2。最新的權利現在是2.2.5。

如果您必須使用Ruby 2.2.2,仍然有希望。對於Ruby 2.2.2,rbenv issue建議a patch;一些用戶說他們爲他們工作。嘗試使用補丁安裝Ruby:

rvm install ruby-2.2.2 --patch https://gist.githubusercontent.com/mislav/055441129184a1512bb5/raw 
+0

它的工作!有它編譯和安裝沒有錯誤!謝謝 –

+0

它在Linux Mint上沒有爲我工作18.2 – RousseauAlexandre

+0

@RousseauAlexandre感謝您的編輯。這個編輯是否使它在Linux Mint中工作,還是問題依然存在? –