我看着这个Ruby installation (2.2.2) fails in macOS Big Sur
我的macOS是Big Sur,我的版本是11.2,这是我能找到的最接近我操作系统问题的版本,我尝试了一下
CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.5.3而且还
RUBY_CFLAGS=-DUSE_FFI_CLOSURE_ALLOC rbenv install 2.5.3这是我的终端中的输出:
Downloading openssl-1.1.1i.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242
Installing openssl-1.1.1i...
Installed openssl-1.1.1i to /Users/richard/.rbenv/versions/2.5.3
Downloading ruby-2.5.3.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.3.tar.bz2
Installing ruby-2.5.3...
WARNING: ruby-2.5.3 is nearing its end of life.
It only receives critical security updates, no bug fixes.
ruby-build: using readline from homebrew
/opt/homebrew/bin/ruby-build: line 1121: 31528 Killed: 9 "$RUBY_BIN" -e '
manager = ARGV[0]
packages = {
"apt-get" => Hash.new {|h,k| "lib#{k}-dev" }.update(
"openssl" => "libssl-dev",
"zlib" => "zlib1g-dev"
),
"yum" => Hash.new {|h,k| "#{k}-devel" }.update(
"yaml" => "libyaml-devel"
)
}
failed = %w[openssl readline zlib yaml].reject do |lib|
begin
require lib
rescue LoadError
$stderr.puts "The Ruby #{lib} extension was not compiled."
end
end
if failed.size > 0
$stderr.puts "ERROR: Ruby install aborted due to missing extensions"
$stderr.print "Try running `%s install -y %s` to fetch missing dependencies.\n\n" % [
manager,
failed.map { |lib| packages.fetch(manager)[lib] }.join(" ")
] unless manager.empty?
$stderr.puts "Configure options used:"
require "rbconfig"; require "shellwords"
RbConfig::CONFIG.fetch("configure_args").shellsplit.each { |arg| $stderr.puts " #{arg}" }
exit 1
end
' "$(basename "$(type -p yum apt-get | head -1)")" 1>&4 2>&1
BUILD FAILED (macOS 11.2 using ruby-build 20210119)
Inspect or clean up the working tree at /var/folders/rn/c7nmr3x12gg5r8qwsr4ty8hh0000gn/T/ruby-build.20210209143521.94730.xfFT9O
Results logged to /var/folders/rn/c7nmr3x12gg5r8qwsr4ty8hh0000gn/T/ruby-build.20210209143521.94730.log
Last 10 log lines:
installing bundled gems: /Users/richard/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0 (build_info, cache, doc, extensions, gems, specifications)
power_assert 1.1.1
net-telnet 0.1.1
did_you_mean 1.2.0
xmlrpc 0.3.0
rake 12.3.0
minitest 5.10.3
test-unit 3.2.7
installing rdoc: /Users/richard/.rbenv/versions/2.5.3/share/ri/2.5.0/system
installing capi-docs: /Users/richard/.rbenv/versions/2.5.3/share/doc/ruby对于上面提到的两个命令,我都得到了这个错误,并且都给出了相同的输出。Ruby的版本似乎也无关紧要,我也尝试了3.0.0,也得到了同样的结果。
此外,这是我尝试使用rbenv install安装ruby时的原始输出
Downloading openssl-1.1.1i.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242
Installing openssl-1.1.1i...
Installed openssl-1.1.1i to /Users/richard/.rbenv/versions/2.5.3
Downloading ruby-2.5.3.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.3.tar.bz2
Installing ruby-2.5.3...
WARNING: ruby-2.5.3 is nearing its end of life.
It only receives critical security updates, no bug fixes.
ruby-build: using readline from homebrew
BUILD FAILED (macOS 11.2 using ruby-build 20210119)
Inspect or clean up the working tree at /var/folders/rn/c7nmr3x12gg5r8qwsr4ty8hh0000gn/T/ruby-build.20210209143107.60561.YqaRpk
Results logged to /var/folders/rn/c7nmr3x12gg5r8qwsr4ty8hh0000gn/T/ruby-build.20210209143107.60561.log
Last 10 log lines:
compiling ../.././ext/psych/yaml/reader.c
compiling ../.././ext/psych/yaml/emitter.c
compiling ../.././ext/psych/yaml/parser.c
linking shared-object json/ext/generator.bundle
5 warnings generated.
linking shared-object date_core.bundle
linking shared-object zlib.bundle
1 warning generated.
linking shared-object psych.bundle
make: *** [build-ext] Error 2xcode-select版本为2384。
自制版本是3.0.0,brew doctor说我准备好酿造了。
我的.zshrc文件也包含这一行eval "$(rbenv init -)"
在这一点上,我不知道还能去哪里,如果你想在日志文件中看到任何细节,让我知道是从哪里来的,日志文件太大了,不能在这里分享。为什么会发生这种情况?我该如何解决?♂️
发布于 2021-02-18 07:08:49
这不是官方的解决方案。我确信rbenv开发人员正在研究一个实际的解决方案,但是这个变通方法应该会帮助那些在Mac的新M1芯片上设置他们的ruby环境的人。
rbenv Removing rbenv。如果在/Users/<your user name>/.rbenv/versions/.中有任何ruby版本(不包括系统默认版本),请确保还删除了所有已下载的ruby版本
使用:/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"卸载
使用arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"安装
如果您运行brew install rbenv,
arch -x86_64 brew install rbenv吗
然后,
arch -x86_64 rbenv install x.x.x (x =某个数字,即2.7.2)安装您想要的版本
然后,您只需记住在安装其他版本的arch -x86_64时告诉brew Ruby。
一旦实际修复完成,您将能够切换回较新的体系结构,而不必使用arch参数。您也不必一直使用brew执行此操作,只需使用rbenv即可。
发布于 2021-03-18 01:08:16
在安装readline openssl之后,我能够安装Ruby2.7.2
brew install readline openssl
rbenv install 2.7.2发布于 2021-05-10 07:48:58
我使用的是rvm。我阅读并尝试了这里讨论的解决方案https://github.com/rvm/rvm/issues/5033。
然而,为我工作的是rvm install "ruby-2.6.3" --with-out-ext=fiddle
如果您正在使用rbenv,您可以访问讨论here
https://stackoverflow.com/questions/66128681
复制相似问题