如何解决安装 ruby 3 时出现段错误 11
我需要在我的机器上安装 ruby 3.0.0 来升级我的 ROR 应用程序 gems,我使用 RVM 作为版本管理但是当我编写 RVM install 3.0.0 时我有这个错误
运行'__rvm_make -j4'时出错,
请阅读/Users/hadii/.rvm/log/1620191440_ruby-3.0.0/make.log
运行 make 时出现错误。停止安装。
当我删除 make.log 文件时,我发现了这个:
tail /Users/hadii/.rvm/log/1620191440_ruby-3.0.0/make.log
./revision.h unchanged
compiling version.c
linking miniruby
warning: no debug symbols in executable (-arch x86_64)
generating x86_64-darwin19-fake.rb
x86_64-darwin19-fake.rb updated
warning: no debug symbols in executable (-arch x86_64)
make: *** [exe/ruby] Segmentation fault: 11
make: *** Deleting file `exe/ruby'
++++++++++++ support:384 @__rvm_make:0> return 2
我在谷歌上搜索了很多东西,做了很多事情,比如从我的机器上卸载 RVM、ruby 并重新安装它,使用这个命令重新配置 RVM:
RVM 得到头
RVM 获取主
我什至遵循这个 link 但没有任何改变,即使我尝试安装更新版本的 ruby-like 3.0.1 甚至尝试这个命令
RVM 安装“ruby-3.0.0”
但是我无法安装任何新版本的 ruby,请帮帮我
我在 iMac 上工作,我的操作系统版本是 Catalina
现在可以使用的 ruby 版本 2.7.1
Rails 5.2.5
房车 1.29.12
更新:
我尝试手动安装 ruby 并按照此 tutorials 操作,但收到此错误消息
BASERUBY = /Users/hadii/.rvm/rubies/ruby-2.7.1/bin/ruby --disable=gems
CC = clang -fdeclspec
LD = clang
LDSHARED = clang -fdeclspec -dynamiclib
CFLAGS = -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -std=gnu99 -pipe
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -fPIE -I. -I.ext/include/x86_64-darwin19 -I./include -I. -I./enc/unicode/12.1.0
CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -fstack-protector-strong -Wl,-pie -framework Security -framework Foundation
SOLIBS = -lpthread -lgmp -ldl -lobjc
LANG = en_US.UTF-8
LC_ALL =
LC_CTYPE =
MFLAGS =
Apple clang version 11.0.0 (clang-1100.0.33.8)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
./revision.h unchanged
make: *** [exe/ruby] Segmentation fault: 11
make: *** Deleting file `exe/ruby'
解决方法
经过长时间的谷歌搜索和我之前解释过的很多问题,我发现了这个 link 解释了这三个命令女巫帮助解决这些问题。
$ sudo rm -rf /Library/Developer/CommandLineTools
$ xcode-select --install
$ sudo xcode-select -s /Library/Developer/CommandLineTools
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。