构建失败Ubuntu 20.04 使用 ruby​​-build 20210119

问题描述

我正在使用 rbenv,在 Ec2 实例中,我尝试安装不同版本的 ruby​​,但是当我执行时

rbenv install 2.7.2

出现以下错误

Downloading ruby-2.7.2.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.2.tar.bz2
Installing ruby-2.7.2...

BUILD Failed (Ubuntu 20.04 using ruby-build 20210119)

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

Last 10 log lines:
compiling mjit.c
compiling mjit_compile.c
compiling node.c
compiling numeric.c
compiling object.c
compiling pack.c
compiling parse.c
gcc: Fatal error: Killed signal terminated program cc1
compilation terminated.
make: *** [Makefile:421: parse.o] Error 1

与此同时,我的系统使用的是认的 ruby​​ 版本

  ubuntu@ip-112-34-9-342:~$ rbenv versions
 * system (set by /home/ubuntu/.rbenv/version)

我不确定是空间问题还是其他问题,空间信息在下面列出。

 ubuntu@ip-112-34-9-342:~$ free
    total        used        free      shared  buff/cache   available
    Mem:         486776      177636       89396         800      219744      287744
    Swap:          0           0           0

解决方法

运行以下命令 -

$ sudo apt install gcc make curl libssl-dev zlib1g-dev

不客气。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...