安装 ruby 2.5.0 的 rvm 编译错误

rvm compiling error to install ruby 2.5.0

我正在尝试使用 rvm 安装 ruby 2.5.0,但出现错误。我在 Ubuntu 18、16 和现在在 Linux 薄荷肉桂上试过。

基本上我之前所做的 运行 安装 ruby 的代码是:

https://rvm.io/rvm/install

上获取 GPG 密钥

然后:

curl -L https://get.rvm.io | bash -s stable

source ~/.rvm/scripts/rvm

rvm requirements

git clone myRepo...

git submodule update --init --recursive (in the folder of the repo)

rvm install ruby-2.5.0

然后在编译时出现此错误:

Error running '__rvm_make -j8',

please read /home/rafael/.rvm/log/1552616898_ruby-2.5.0/make.log

There has been an error while running make. Halting the installation.

最后在 make.log 中我们有:

[2019-03-14 23:28:45] __rvm_make
__rvm_make ()
{
    \make "$@" || return $?
}
current path: /home/rafael/.rvm/src/ruby-2.5.0
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/rafael/.rvm/bin:/home/rafael/.rvm/bin
command(2): __rvm_make -j8
++ make -j8
        CC = gcc
        LD = ld
        LDSHARED = gcc -shared
        CFLAGS = -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wmisleading-indentation -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wimplicit-fallthrough=0 -Wduplicated-cond -Wrestrict -std=gnu99  -fPIC
        XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT
        CPPFLAGS =   -I. -I.ext/include/x86_64-linux -I./include -I. -I./enc/unicode/10.0.0
        DLDFLAGS = -Wl,--compress-debug-sections=zlib -Wl,-soname,libruby.so.2.5  -fstack-protector
        SOLIBS = -lpthread -lgmp -ldl -lcrypt -lm
        LANG = pt_BR.UTF-8
        LC_ALL =
        LC_CTYPE =
gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
compiling ./main.c
compiling dmydln.c
compiling miniinit.c
compiling dmyext.c
generating miniprelude.c
executable host ruby is required. use --with-baseruby option.
making dummy probes.h
compiling bignum.c
uncommon.mk:960: recipe for target 'miniprelude.c' failed
make: *** [miniprelude.c] Error 1
make: ** Esperando que outros processos terminem.
++ return 2

有什么方法可以帮助我吗?

一些注意事项: 可以安装 ruby 2.5.1、2.5.2、2.5.3、2.5.4。但我想要 2.5.0。 现在我正在使用 Linux 薄荷肉桂

提前致谢。

注意这个:

executable host ruby is required. use --with-baseruby option.

你不能用 RVM 编译 Ruby 除非 Ruby 已经存在于系统中。 运行这首:

sudo apt-get install ruby-full

然后再运行:

rvm install ruby-2.5.0