错误 运行 '__rvm_make -j 1'

Error running '__rvm_make -j 1'

今天我试图安装 ruby 2.5.0,但我每次都遇到这个错误。

控制台输出我得到的错误

rvm install ruby-2.5.0
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.13/x86_64/ruby-2.5.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates bundle '/usr/local/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/andreiaalmeida/.rvm/rubies/ruby-2.5.0, this may take a while depending on your cpu(s)...
ruby-2.5.0 - #downloading ruby-2.5.0, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 13.3M  100 13.3M    0     0   429k      0  0:00:31  0:00:31 --:--:--  490k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.5.0 - #extracting ruby-2.5.0 to /Users/andreiaalmeida/.rvm/src/ruby-2.5.0....
ruby-2.5.0 - #configuring......................................................|
ruby-2.5.0 - #post-configuration.
ruby-2.5.0 - #compiling...

Error running '__rvm_make -j 1',
please read /Users/andreiaalmeida/.rvm/log/1519558776_ruby-2.5.0/make.log
There has been an error while running make. Halting the installation.

我的make.log文件

[2018-02-25 11:40:33] __rvm_make
__rvm_make () 
{ 
    \make "$@" || return $?
}
current path: /Users/andreiaalmeida/.rvm/src/ruby-2.5.0
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/andreiaalmeida/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/opt/X11/bin:/Users/andreiaalmeida/.rvm/bin
command(3): __rvm_make -j 1
++ make -j 1
    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/andreiaalmeida/.rvm/rubies/ruby-2.5.0/lib/libruby.2.5.dylib -compatibility_version 2.5 -current_version 2.5.0  -fstack-protector -framework Foundation  -fstack-protector -framework Foundation  
    SOLIBS = -lpthread -lgmp -ldl -lobjc 
    LANG = 
    LC_ALL = 
    LC_CTYPE = UTF-8
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
compiling ./main.c
compiling dmydln.c
compiling miniinit.c
compiling dmyext.c
compiling miniprelude.c
translating probes probes.d
error: error reading '/dev/fd/4'
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
++ return 2

我尝试完全卸载 rvm(rvm 内爆)并重新安装,但我没有成功。

系统

尝试rvm install 2.5.0 --disable-dtrace

原因就在这里,https://github.com/rbenv/ruby-build/issues/1061,

可能Ruby构建问题

我遇到了和楼主一样的问题。

编译将在

停止
ruby-2.2.6 - #compiling...                                                                                                                   
Error running '__rvm_make -j 1',                                           
please read /Users/alexharvey/.rvm/log/1525652818_ruby-2.2.6/make.log
There has been an error while running make. Halting the installation.

检查 make.log 发现:

translating probes probes.d
error: error reading '/dev/fd/4'
1 error generated.
clang: error: unable to remove file: Operation not permitted

我终于在 this link 中找到了对 Avira Anti-virus 的引用。

我转到 Avira Anti-virus 并选择 "disable real time protection" 并重试。那修好了。

ruby-2.4.6 - #compiling - 请稍候 错误 运行 '__rvm_make -j4', 请阅读 /Users/mgq/.rvm/log/1557891511_ruby-2.4.6/make.log

运行 make 时出错。正在停止安装。

Avira 杀毒软件似乎是 运行。据报道,它会导致 ruby 编译失败。 在安装时禁用它并重试。

make.log

  • __rvm_make:0> 制作-j4
  • '******************'
  • 错误:读取“/dev/fd/7”时出错
  • 产生了 1 个错误。
  • clang:错误:无法删除文件:不允许操作