使用rbenv BUILD FAILED安装ruby-2.0.0-p0

时间:2013-05-06 17:43:07

标签: ruby install rbenv

所以我尝试在我运行在VirtualBox上的新ubuntu 12.04LTS上通过rbenv安装ruby。

我从https://github.com/sstephenson/rbenv获得了rbenv,从https://github.com/sstephenson/ruby-build获得了ruby-build。

然后我运行以下命令,但构建失败:(

rbenv install 2.0.0-p0
Downloading ruby-2.0.0-p0.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
Installing ruby-2.0.0-p0...

BUILD FAILED

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

Last 10 log lines:
installing default gems:      /home/shivin/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0     (build_info, cache, doc, gems, specifications)
                          bigdecimal 1.2.0
                          io-console 0.4.2
                          json 1.7.7
                          minitest 4.3.2
                          psych 2.0.0
                          rake 0.9.6
                          rdoc 4.0.0
                          test-unit 2.0.0.0
The Ruby openssl extension was not compiled. Missing the OpenSSL lib?

任何帮助将不胜感激。如果您需要更多详细信息,请与我们联系。谢谢!

3 个答案:

答案 0 :(得分:10)

您将需要libssl-dev。为了获得最佳结果,请安装rvm autolibs函数将为您安装的所有requirements。其中一些(如sqlite3)假设您最终想要安装Rails,但如果您不需要它们则无害。

答案 1 :(得分:1)

很可能你需要openssl扩展作为先决条件:

sudo apt-get install openssl

应该诀窍。之后重新启动您的RBENV安装。

答案 2 :(得分:0)

遇到同样的问题。 moschop对线程的建议有效!

sudo apt-get install libssl-dev

然后

rbenv install 2.0.0-p247

每次安装Ruby版本或gem

时都必须重新进行重新扫描
 rbenv rehash

默认使用Ruby版本:

rbenv global 2.0.0-p247