macにCocoaPodsをインストールする方法

ターミナルでインストール ターミナルを開く sudo gem install cocoapodsを実行 →なぜか下記のようなエラーメッセージが出てインストールに失敗した。 出力 ERROR: Error installing cocoapods: The last version of activesupport (>= 5.0, < 8) to support your Ruby & RubyGems was 6.1.7.3. Try installing it with `gem install activesupport -v 6.1.7.3` and then running the current command again activesupport requires Ruby version >= 2.7.0. The current ruby version is 2.6.10.210. そこでエラーメッセージをWeb検索して(以下「参考」を参照)、下記のコマンドを実行した /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 出力 ==> Checking for `sudo` access (which may request your password)....