rbenv ruby​​安装失败ubuntu

时间:2015-01-07 05:24:49

标签: ruby rbenv

这是错误日志

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 20141225-7-g4aeeac2)

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

Last 10 log lines:

compiling ossl_x509store.c
compiling ossl_engine.c
compiling ossl_ocsp.c
compiling ossl_config.c
compiling ossl_digest.c
installing default openssl libraries
linking shared-object openssl.so
make[2]: Leaving directory /tmp/ruby-build.20150106233051.25615/ruby-2.2.0/ext/openssl'
make[1]: Leaving directory/tmp/ruby-build.20150106233051.25615/ruby-2.2.0'
make: *** [build-ext] Error 2

我不知道该怎么做。我尝试了这个,但是当我输入ruby -v时,它仍然告诉我我有旧版本。

sudo apt-get install autoconf bison libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev 

感谢您提出的任何意见,非常感谢。

3 个答案:

答案 0 :(得分:8)

首先安装这些依赖项然后重试为我在14.04上为ruby 2.2.0使用rbenv

sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev

答案 1 :(得分:3)

所有其他的导师都失败了......

经过多次失败的尝试和研究后,我发现了许多版本的解决方法:

<强> 2.1.1

curl -fsSL https://gist.github.com/mislav/a18b9d7f0dc5b9efc162.txt | rbenv install --patch 2.1.1

<强> 2.0.0-P451

curl -fsSL https://gist.github.com/LeonB/10503374/raw | rbenv install --patch 2.0.0-p451

<强> 2.0.0-P247

cat <(curl -fsSL https://raw.githubusercontent.com/wayneeseguin/rvm/master/patches/ruby/changeset_r45225.diff) <(curl -fsSL https://raw.githubusercontent.com/wayneeseguin/rvm/master/patches/ruby/changeset_r45240.diff) | sed -E 's/^((---|\+\+\+) )(a|b)\/([^ ]+\s+\(revision [0-9]+\))$/\1\4/' | sed '/rl_delete_text/d' | rbenv install -p 2.0.0-p247

来源:https://github.com/sstephenson/ruby-build/issues/526

希望我能帮助任何人。

答案 2 :(得分:1)

如果您使用的是Ubuntu和Debian,则可以尝试通过apt-get安装libffi-dev。

$ apt-get install libffi-dev

我在论坛上做了一些研究,我在官方的rbenv问答部分找到了这个。

https://github.com/sstephenson/ruby-build/wiki#build-failure-of-fiddle-with-ruby-220