2015-01-13 140 views
6

試圖Setup Ruby On Rails on Ubuntu 14.04 Trusty Tahr錯誤與`rbenv安裝2.2.0`

控制檯錯誤輸出繼電器:

rbenv install 2.2.0 
Downloading ruby-2.2.0.tar.gz... 
-> http://dqw8nmjcqpjn7.cloudfront.net/7671e394abfb5d262fbcd3b27a71bf78737c7e9347fa21c39e58b0bb9c4840fc 
Installing ruby-2.2.0... 

BUILD FAILED (Ubuntu 14.04 using ruby-build 20150112) 

Inspect or clean up the working tree at /tmp/ruby-build.20150113142305.19357 
Results logged to /tmp/ruby-build.20150113142305.19357.log 

Last 10 log lines: 
compiling ossl_digest.c 
compiling ossl_x509name.c 
compiling ossl_bio.c 
compiling ossl_config.c 
compiling ossl_asn1.c 
installing default openssl libraries 
linking shared-object openssl.so 
make[2]: Leaving directory `/tmp/ruby-build.20150113142305.19357/ruby-2.2.0/ext/openssl' 
make[1]: Leaving directory `/tmp/ruby-build.20150113142305.19357/ruby-2.2.0' 
make: *** [build-ext] Error 2 

Log file ruby-build.20150113142305.19357.log.

回答

15

的Ruby 2.2.0需要libffi的開發人員版本,所以這應該幫助:

sudo apt-get install libffi-dev

+0

我在Ubuntu 12.04上。這也適用於我。 –

0

我試過托馬什Dundáček的答案,但它並沒有爲我工作,我必須安裝之後,使其工作

sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6 libreadline6-dev zlib1g zlib1g-dev 
0

正如一個側面說明:我有這個問題,rbenv install 2.2.1(和安裝libffi-dev的解決了這個問題),但不與現在出來的2.2.2版本。無論如何,您應該使用最新的修補程序版本,以便可以解決問題。我很想知道,如果我是唯一一個遇到2.2.1而不是2.2.2的問題。