【发布时间】:2021-04-12 18:48:13
【问题描述】:
最终我正在尝试安装 Cocoapods,它会产生错误: 构建原生扩展错误:安装 cocoapods 错误错误:构建 gem 原生扩展失败
..我认为这是因为 ruby 不是最新的(停留在 2.6)。
我试过了 酿造安装红宝石 和 brew重新安装红宝石 ...仍然是 v2.6
DOUGs-MacBook-Pro:LOCATION dbell$
DOUGs-MacBook-Pro:LOCATION dbell$
DOUGs-MacBook-Pro:LOCATION dbell$
DOUGs-MacBook-Pro:LOCATION dbell$
DOUGs-MacBook-Pro:LOCATION dbell$ brew install ruby
Updating Homebrew...
Warning: ruby 3.0.1 is already installed and up-to-date.
To reinstall 3.0.1, run:
brew reinstall ruby
DOUGs-MacBook-Pro:LOCATION dbell$ ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
DOUGs-MacBook-Pro:LOCATION dbell$
DOUGs-MacBook-Pro:LOCATION dbell$ brew reinstall ruby
==> Downloading https://ghcr.io/v2/homebrew/core/ruby/manifests/3.0.1
Already downloaded: /Users/dbell/Library/Caches/Homebrew/downloads/6d2a0e9cda0072647ac4fcb119f4f0263b91503dc918ba80d057da0897a3f994--ruby-3.0.1.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/ruby/blobs/sha256:1af6edba23ff9aa12fcab0fee9246cf46110263bf962e46e800152096b0c7017
Already downloaded: /Users/dbell/Library/Caches/Homebrew/downloads/7d7455d376fe2f0401873034dc82e6daae1f05efe465847b4db1464a73155c8f--ruby--3.0.1.catalina.bottle.tar.gz
==> Reinstalling ruby
==> Pouring ruby--3.0.1.catalina.bottle.tar.gz
==> Caveats
By default, binaries installed by gem will be placed into:
/usr/local/lib/ruby/gems/3.0.0/bin
You may want to add this to your PATH.
ruby is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have ruby first in your PATH, run:
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.profile
For compilers to find ruby you may need to set:
export LDFLAGS="-L/usr/local/opt/ruby/lib"
export CPPFLAGS="-I/usr/local/opt/ruby/include"
==> Summary
???? /usr/local/Cellar/ruby/3.0.1: 16,358 files, 38.4MB
DOUGs-MacBook-Pro:LOCATION dbell$ ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
DOUGs-MacBook-Pro:LOCATION dbell$
我尝试重新启动 Mac。还是 2.y
【问题讨论】: