RVM编译错误以安装ruby 2.5.0

时间:2019-03-15 02:48:05

标签: ruby-on-rails ruby compiler-errors installation rvm

我正在尝试使用rvm安装ruby 2.5.0,但出现错误。我在Ubuntu 18、16和现在的Linux Mint Cinnamon上进行了尝试。

在运行代码以安装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

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

  

运行'__rvm_make -j8'时出错,

     

请阅读/home/rafael/.rvm/log/1552616898_ruby-2.5.0/make.log

     

运行make时发生错误。停止安装。

最后是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 Mint Cinnamon

谢谢。

1 个答案:

答案 0 :(得分:0)

请注意以下事项:

merge()

除非系统上已经存在Ruby,否则无法使用RVM编译Ruby。首先运行:

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

然后重新运行:

sudo apt-get install ruby-full