在 Mac 上为 Github 页面安装 Ruby 时出错

问题描述 投票:0回答:1

我是一位经验丰富的程序员,但对 Ruby 还很陌生,而且我在安装它以设置 Github Pages 时遇到了困难。我正在运行 2015 款 MacBook Pro,运行 12.7 macOS Monterey,配备 Intel Core i7 处理器。

我都尝试过

ruby-install 3.1.3
ruby-install 3.1.3 -- --enable-shared
,以及
rbenv install 3.1.3
,但所有三个都收到以下错误:

linking miniruby
Undefined symbols for architecture x86_64:
  "_coroutine_transfer", referenced from:
      _fiber_setcontext in cont.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [miniruby] Error 1
!!! Compiling ruby 3.1.3 failed!

brew config
返回:

HOMEBREW_VERSION: 4.1.16
ORIGIN: https://github.com/Homebrew/brew
HEAD: c0c8a4dd4dd19ec16deb429abd50cdf82ea33b27
Last commit: 5 days ago
Core tap JSON: 20 Oct 00:15 UTC
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.10 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit haswell
Clang: 14.0.0 build 1400
Git: 2.14.1 => /usr/local/bin/git
Curl: 8.1.2 => /usr/bin/curl
macOS: 12.7-x86_64
CLT: 14.2.0.0.1.1668646533
Xcode: N/A

我的 Xcode 命令行工具似乎工作正常:

xcode-select --install
告诉我“命令行工具已安装”并且
xcode-select -p
返回
/Library/Developer/CommandLineTools
。我不认为我需要安装完整的 Xcode 并且目前没有空间,但如果需要的话可以这样做。

我也尝试从 Apple 降级到 Xcode CLT 13.4 并重新安装,但收到与上面相同的错误消息。

任何帮助将不胜感激!谢谢

ruby macos github-pages
1个回答
0
投票

我使用 rbenv 不断收到相同的错误,并且使用brew install 确实成功安装了 Ruby,但在尝试安装 gem 时我不断收到权限错误。

Daniel Kehoe 的这篇关于使用 asdf 的教程终于对我有用了。感谢您的帮助!

© www.soinside.com 2019 - 2024. All rights reserved.