繁体   English   中英

尝试在 ubuntu 14.04.3 LTS 上使用 rbenv 安装 ruby​​ v 2.2.2 时出现构建失败错误

[英]Build failed error when trying to install ruby v 2.2.2 with rbenv on ubuntu 14.04.3 LTS

安装 rbenv 后,我尝试安装 ruby​​ v2.2.2,但出现此错误。 我对 Ubuntu 和 Ruby 很陌生,想知道是否有办法解决这个问题。 谢谢你。

BUILD FAILED (Ubuntu 14.04 using ruby-build 20150818-4-g8d6ff29)

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

Last 10 log lines:
checking for gmp.h... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking whether byte ordering is bigendian... no
checking for an ANSI C-conforming const... yes
checking whether char is unsigned... no
checking for inline... no
checking for working volatile... no
checking for typeof syntax and keyword spelling... __typeof__
configure: error: ANSI C-conforming const and volatile are mandatory

我也做了以下事情,但无济于事:

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

这是由 GCC 版本不匹配引起的。 您的 GCC 版本对于这个特定的 Ruby 版本来说“太新”了。 以下是如何克服这个问题。

环境

CFLAGS="-O2 -fno-tree-dce -fno-optimize-sibling-calls" rbenv install [your-version]

房车

CFLAGS="-O2 -fno-tree-dce -fno-optimize-sibling-calls" rvm install [your-version]

该问题似乎是由于缺少软件包引起的。

本文详细介绍了如何“在 Ubuntu 14.04 Trusty Tahr 上设置 Ruby On Rails”。 您的问题已在本文的“安装 Ruby”部分中得到解答。

首先,安装所有依赖项。

sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev

现在你可以使用 rbenv 来安装 ruby​​:

rbenv install 2.2.2

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM