ruby-on-rails - rvm编译安装ruby 2.5.0出错

标签 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 key

然后:

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 Mint Cinnamon

提前致谢。

最佳答案

注意这一点:

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

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

sudo apt-get install ruby-full

然后重新运行:

rvm install ruby-2.5.0

关于ruby-on-rails - rvm编译安装ruby 2.5.0出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55174853/

相关文章:

ruby - 如何使用正则表达式交换 ruby​​ 字符串中的数字位置?

ruby-on-rails - 如何使用 ruby​​ 中的 Mechanize 检测新的博客文章

mysql - 查找最新记录 : left outer join vs. 降序排序

ruby-on-rails - Rails 4 ActiveRecord 在 Ubuntu 13.04 上抛出 PG::UnableToSend

ruby-on-rails - 使用 RSpec 测试多态关联

java - stmt.executeUpdate 上的 java servlet 中出现错误

c++ - 确保 g++ 不会使用新版本 C++ 中添加的功能编译程序

ruby-on-rails - Rails 3.1 中 API 链接的最佳放置位置是哪里

ruby - 为什么我的 ruby​​ 脚本中出现无限循环?

c++ - boost log non-const bitfield 编译错误(向后兼容问题)