使用 zsh - 以前使用 bash 工作
brew doctor - 您的系统已准备好进行 brew。
flutter doctor 出现此错误
[!] Xcode - develop for iOS and macOS (Xcode 12.2)
✗ CocoaPods installed but not working.
You appear to have CocoaPods installed but it is not working.
This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
This can usually be fixed by re-installing CocoaPods. For more info, see https://github.com/flutter/flutter/issues/14293.
To re-install CocoaPods, run:
sudo gem install cocoapods
使用sudo命令安装CocoaPods
Gives this error
dyld: Library not loaded: /usr/local/opt/gmp4/lib/libgmp.3.5.2.dylib
Referenced from: /Users/puser/.rvm/rubies/ruby-2.5.1/bin/ruby
Reason: image not found
zsh: abort sudo gem install cocoapods
我无法解决上述错误-有什么建议吗?哪个pod?
/Users/puser/.rvm/rubies/ruby-2.5.1/bin/pod
哪个 gem
gem () {
\typeset result
(
\typeset rvmrc
rvm_rvmrc_files=("/etc/rvmrc" "$HOME/.rvmrc")
if [[ -n "${rvm_prefix:-}" ]] && ! [[ "$HOME/.rvmrc" -ef "${rvm_prefix}/.rvmrc" ]]
then
rvm_rvmrc_files+=("${rvm_prefix}/.rvmrc")
fi
for rvmrc in "${rvm_rvmrc_files[@]}"
do
[[ -s "${rvmrc}" ]] && source "${rvmrc}" || true
done
unset rvm_rvmrc_files
command gem "$@"
) || result=$?
hash -r
return ${result:-0}
}
哪个ruby
/Users/puser/.rvm/rubies/ruby-2.5.1/bin/ruby
rvm install ruby-2.6 --with-out-ext=fiddle
在我的情况下,安装的版本是 2.6.6。所以也许你需要改变这个特定的版本。 - Seong Jun\curl -sSL https://get.rvm.io | bash -s stable
下载,之后我安装了rvm install ruby-2.7.2
。确保你没有使用Homebrew安装CocoaPods,如果有,请使用brew uninstall cocoapods
卸载。然后,rvm --default use 2.7.2
和sudo gem install cocoapods
对我起作用了。 - biniam