尝试使用RVM安装Ruby时运行'__rvm_make -j8'时出错

时间:2018-07-05 21:08:20

标签: ruby command-line terminal installation rvm

我正在尝试使用RVM安装Ruby。我一直在关注Installfest guide over at RailsBridge

到目前为止,我已经安装了RVM(curl -L get.rvm.io | bash -s stable)并配置了RVM以使用Homebrew(rvm autolibs homebrew)。在终端机中输入rvm install ruby时,得到以下输出:

ruby-2.5.1 - #removing src/ruby-2.5.1..
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.13/x86_64/ruby-2.5.1.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx_brew.
Certificates bundle '/usr/local/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/jules/.rvm/rubies/ruby-2.5.1, this may take a while depending on your cpu(s)...
ruby-2.5.1 - #downloading ruby-2.5.1, this may take a while depending on your connection...
ruby-2.5.1 - #extracting ruby-2.5.1 to /Users/jules/.rvm/src/ruby-2.5.1.....
ruby-2.5.1 - #configuring......................................................|
ruby-2.5.1 - #post-configuration.
ruby-2.5.1 - #compiling....
Error running '__rvm_make -j8',
please read /Users/jules/.rvm/log/1530823409_ruby-2.5.1/make.log
There has been an error while running make. Halting the installation.

我打开/Users/jules/.rvm/log/1530823409_ruby-2.5.1/make.log试图取得进展,但是我无法从文件中收集任何含义。我粘贴了以下内容:

[2018-07-05 16:44:45] __rvm_make
__rvm_make () 
{ 
    \make "$@" || return $?
}
current path: /Users/jules/.rvm/src/ruby-2.5.1
PATH=/usr/local/opt/coreutils/bin:/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/Users/jules/anaconda2/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Users/jules/.rvm/bin
command(2): __rvm_make -j8
++ make -j8
    CC = gcc
    LD = ld
    LDSHARED = gcc -dynamiclib
    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 -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens   -fno-common -pipe 
    XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT
    CPPFLAGS = -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -I. -I.ext/include/x86_64-darwin17 -I./include -I. -I./enc/unicode/10.0.0
    DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl@1.1/lib -install_name /Users/jules/.rvm/rubies/ruby-2.5.1/lib/libruby.2.5.dylib -compatibility_version 2.5 -current_version 2.5.1  -fstack-protector -framework Foundation  -fstack-protector -framework Foundation  
    SOLIBS = -lpthread -lgmp -ldl -lobjc 
    LANG = en_US.UTF-8
    LC_ALL = 
    LC_CTYPE = 
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
compiling ./main.c
compiling dmydln.c
compiling miniinit.c
compiling dmyext.c
compiling miniprelude.c
translating probes probes.d
compiling bignum.c
compiling class.c
compiling compar.c
compiling compile.c
error: error reading '/dev/fd/7'
1 error generated.
clang: error: unable to remove file: Operation not permitted
dtrace: failed to compile script probes.d: Preprocessor failed to process input program
make: *** [probes.h] Error 1
make: *** Waiting for unfinished jobs....
++ return 2

我应该从这里去哪里?干杯!

4 个答案:

答案 0 :(得分:2)

更新:我从make.log中搜索了error: error reading '/dev/fd/7',并通过卸载了Avira:https://github.com/rvm/rvm/issues/4313解决了该问题。

答案 1 :(得分:1)

这对我有用:

rvm install ruby-2.5.1 --with-openssl-dir=/usr/local/opt/openssl

答案 2 :(得分:0)

openssl标志修复了我的错误!如果有帮助,mymake.log的最后一行是:

openssl_missing.c:39:18: error: expected ';' after top level declarator
EVP_MD_CTX_create(void)

答案 3 :(得分:0)

这对我有用:

将/ usr / local / include重命名为/ usr / local / include_old

参考:Broken c++ std libraries on macOS High Sierra 10.13