LoginSignup
25
19

More than 3 years have passed since last update.

特定のバージョンのCocoaPodsをインストールする

Posted at

ちゃんとバージョン合わせないと動かない時があるのでちゃんとチームで合わせましょう。

CocoaPods

※2020/3のブログ記事の転載になります

手順0-1 brewでいれたものがあれば削除

podは公式だとgemでインストールする手順が紹介されていますが、brewでもインストールする事ができます。

homebrewでいれたバージョンが入っていると、gemでインストールしてもうまくいかなかったりするので、消してしまいましょう。

今動いているpodが、brewでいれたものかどうかは、pathをみればわかります。


$ which pod
/usr/local/bin/pod

となっていたら、brew版が入っています。brew版は大体古いです。

gemでいれた場合は、↓のような感じになります。(rbenvを使っている場合)

/Users/XXXXX/.rbenv/shims/pod

削除はこのコマンドで。


$ brew uninstall cocoapods

手順0-2 既存のバージョンを削除


$ gem uninstall cocoapods

今入っているバージョンは一旦削除しちゃいましょう。

インストール

$ gem install cocoapods -v 1.8.4

うまくいけばこうなります。


$ pod --version 
1.8.4

おまけ

バージョンが違うとこんなwarningが出ることがあります。


    [!] The version of CocoaPods used to generate the lockfile (1.9.0) is higher than the version of the current executable (1.8.4). Incompatibility issues may arise.
Incompatibility issues may arise.(互換性がない事によるなにかが起こるかもしれないよ)

という事なので、おとなしく合わせておきましょう。

参考

CocoaPodsのバージョンアップの方法 - Qiita
Gemのインストール、バージョン指定など - Qiita

25
19
0

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
25
19