LoginSignup
4
4

More than 5 years have passed since last update.

Xcodeの8系を利用しているとbrew installできない問題

Posted at

Xcodeの8系(8.2)だけを入れた状態でbrew installをしようとすると失敗する

$ brew install readline
Error: Your Xcode (8.2) is too outdated.
Please update to Xcode 9.4 (or delete it).
Xcode can be updated from the App Store.

->Xcodeのバージョンを9系にアップデートしないといけないよう。とはいえ、現状使っている8系のバージョンも引き続き利用したい。そこで、複数バージョン利用できるようにする。

Xcodeの9系をインストールする。(9.2をインストールした。)

  • Xcode 9.2.xipなどをダウンロード
    https://developer.apple.com/download/more/

  • 解凍して、「Xcode.app」 -> 「Xcode9.2.app」に名前変更して、アプリケーション配下に移動

  • 「$ sudo xcode-select --switch /Applications/Xcode9.2.app」でパスを通す

$ sudo xcode-select --switch /Applications/Xcode9.2.app

Xcode9.2.appは自分の環境にあるXcodeの名前

再度brew installしてみる

$ brew install readline
Error: You have not agreed to the Xcode license. Please resolve this by running:
  sudo xcodebuild -license accept

->ライセンスが許可されていないよう

指示された通りにコマンド打ち、再度brew install

$ sudo xcodebuild -license accept
$ brew install readline
...
==> Summary
🍺  /usr/local/Cellar/readline/7.0.3_1: 46 files, 1.5MB

->成功した!

4
4
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
4
4