0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

CocoaPodsを指定バージョンでアップデートする方法

Last updated at Posted at 2025-03-08

CocoaPodsを指定バージョン(1.16.2)にアップデートする方法

備忘録です。開発メンバーでバージョン一致させておくために。

まず、現在インストールされているバージョンを確認できます

pod --version

指定バージョン(1.16.2)にアップデートするには、以下のコマンドを実行します

sudo gem install cocoapods -v 1.16.2

もし特定のバージョンをインストールする際に問題が発生した場合は、まず既存のCOCOAPODSをアンインストールしてから再インストールすることも効果的です

sudo gem uninstall cocoapods
sudo gem install cocoapods -v 1.16.2

インストール後、再度バージョンを確認して正しくアップデートされたか確認できます

pod --version

これで、COCOAPODSが指定のバージョン1.16.2にアップデートされるはずです。

それでもバージョンが変わらないよという時

このコマンドを実行することで、インストールされているすべての gem の古いバージョンを削除し、キャッシュもクリアします。

1. すべての CocoaPods 関連の gem をアンインストール

sudo gem uninstall cocoapods --all
sudo gem uninstall cocoapods-core --all
sudo gem uninstall cocoapods-downloader --all
sudo gem uninstall cocoapods-try --all
sudo gem uninstall cocoapods-deintegrate --all
sudo gem uninstall cocoapods-plugins --all
sudo gem uninstall cocoapods-search --all

2. gem のキャッシュをクリア

sudo gem cleanup

3. 特定のバージョンをインストール

sudo gem install cocoapods -v 1.16.2

4. バージョン確認

pod --version

まだまだバージョン変わらないよって時

homebrew でインストールされていた場合があります。homebrew 経由でアンインストールする必要がありますね。以下の手順を試してみてください

1. まず homebrew 経由で CocoaPods をアンインストールします

brew uninstall cocoapods

2. homebrew のキャッシュをクリーンアップします

brew cleanup

3. パスが残っていないか確認します

which pod

これで大丈夫でしょう!

0
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?