今天我尝试安装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 implode)并重新安装它,但我没有成功。
系统
答案 0 :(得分:4)
尝试rvm install 2.5.0 --disable-dtrace
原因在于https://github.com/rbenv/ruby-build/issues/1061,
可能的Ruby构建问题
答案 1 :(得分:4)
我遇到了与原始海报相同的问题。
编译将暂停
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链接中找到了对Avira Anti-virus的引用。
我去了Avira Anti-virus并选择了“禁用实时保护”并再次尝试。修好了。
答案 2 :(得分:0)
ruby-2.4.6-#compiling-请稍候 运行'__rvm_make -j4'时出错, 请阅读/Users/mgq/.rvm/log/1557891511_ruby-2.4.6/make.log
运行make时发生错误。停止安装。
似乎Avira防病毒软件正在运行。据报道会导致红宝石编译失败。 在安装时将其禁用,然后重试。