MacでCocoapodを削除する方法
概要
Flutter Doctor (MacOS Sonoma) を実行すると、cocoapods がインストールされていることが表示されます。
[!] Xcode - develop for iOS and macOS (Xcode 15.0)
✗ 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.
To re-install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
しかし、それを削除しようとすると、次のようになります。
george@mycomputer % sudo gem uninstall cocoapods
Gem 'cocoapods' is not installed
george@mycomputer % sudo gem uninstall -n /usr/local/bin cocoapods
Gem 'cocoapods' is not installed
george@mycomputer ~ % brew uninstall cocoapods
Error: Cask 'cocoapods' is not installed.
他にどこに、どのようにココアポッドが存在する可能性があるのでしょうか?また、それを除去するにはどうすればよいでしょうか?
解決策
RubyGems を使用して Cocoapod の最新バージョンに更新しようとしたときに、最新の OS Sonoma 上の Cocoapod にも同様の問題が見つかりました。
私にとってうまくいったのは、自作の CLI を使用することでした。
https://translate.google.com/translate?hl=ja&sl=en&tl=ja&u=https://brew.sh/
homebrewをインストールして以下のコマンドを実行
醸造アンインストールココアポッド
次に、ホームフォルダー内の Cocoapods への参照をすべて削除します。
rm -rf ~/.cocoapods/