新手问题 使用 rvm 安装 ruby 失败

Mind · 2018年03月19日 · 最后由 Mind 回复于 2018年03月19日 · 4801 次阅读

命令:

rvm install 2.2.5 

报错:

ruby-2.2.5 - #removing src/ruby-2.2.5 - please wait
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.13/x86_64/ruby-2.2.5.
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/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/mind1949/.rvm/rubies/ruby-2.2.5, this may take a while depending on your cpu(s)...
ruby-2.2.5 - #downloading ruby-2.2.5, this may take a while depending on your connection...
ruby-2.2.5 - #extracting ruby-2.2.5 to /Users/mind1949/.rvm/src/ruby-2.2.5 - please wait
ruby-2.2.5 - #applying patch /Users/mind1949.rvm/patches/ruby/2.2.5/openssl3.patch - please wait
ruby-2.2.5 - #configuring - please wait
ruby-2.2.5 - #post-configuration - please wait
ruby-2.2.5 - #compiling - please wait
Error running '__rvm_make -j 1',
please read /Users/mind1949/.rvm/log/1521429775_ruby-2.2.5/make.log
There has been an error while running make. Halting the installation.

vim /Users/mind1949/.rvm/log/1521429775_ruby-2.2.5/make.log

打印出内容:

+__rvm_make:0> make -j 1
        CC = gcc
        LD = ld
        LDSHARED = gcc -dynamiclib
        CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -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/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -I. -I.ext/include/x86_64-darwin17 -I./include -I.
        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/lib  -install_name /Users/mind1949/.rvm/rubies/ruby-2.2.5/lib/libruby.2.2.0.dylib -current_version 2.2.0 -compatibility_version 2.2.0  -fstack-protector -Wl,-u,_objc_msgSend -framework CoreFoundation  -fstack-protector -Wl,-u,_objc_msgSend -framework CoreFoundation
        SOLIBS = -lpthread -ldl -lobjc
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
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
+__rvm_make:0> return 2

卸载/重装了 rvm,报错还是和上面一样

试一试 rvm install 2.2.5 --disable-binary

ruomu 回复

不行 报错都一样😂

clang: error: unable to remove file: Operation not permitted 是不是权限问题?

w7938940 回复

好像是的 可是不知道怎么改

Mind 回复

看来应该是权限问题,加上 sudo 试试?

sudo rvm install 2.2.5 
Mind 回复

你的 rvm 是用 sudo 装的吗,如果是那使用 rvm install 的时候应该也要加 sudo

gingerhot 回复

不可以 我现在着手将电脑初始化了

w7938940 回复

不是 后来又按照 ruby-china 上的教程重装了 可还是和以前报一样的错

用了最笨的方法,重装系统😂 问题算是解决了

Mind 关闭了讨论。 05月25日 16:56
需要 登录 后方可回复, 如果你还没有账号请 注册新账号