macOS Sierraにアップグレード

macOS Sierra にアップグレードして設定したことを書いておきます。

環境

  • macOS Sierra バージョン 10.12(16A323)
  • xcode-select version 2345.1.
  • Homebrew バージョン 1.0.7-7-g6be6ce3

はじめに

Homebrewを使うと次のようなエラーが出ていましたので対応しました。

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

Xcodeコマンドラインツールのインストール

エラーの原因はXcodeコマンドラインツールがmacOS Sieeraのアップグレードによってなくなってしまったことのようでした。 なので、インストールします。 以前に書いた記事の通りインストールしました。 OS X El Capitanにアップグレードした時も同じでしたね。

Homebrewのインストール

Homebrew の Troubleshootingをすると、次のようなメッセージが表示されました。

$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: /usr/local is not writable.

You should change the ownership and permissions of /usr/local
back to your user account.
  sudo chown -R $(whoami) /usr/local

Warning: /usr/local is not writable.
Even if this directory was writable when you installed Homebrew, other
software may change permissions on this directory. For example, upgrading
to OS X El Capitan has been known to do this. Some versions of the
"InstantOn" component of Airfoil or running Cocktail cleanup/optimizations
are known to do this as well.

You should change the ownership and permissions of /usr/local back to
your user account.
  sudo chown -R $(whoami) /usr/local

Warning: You are using OS X 10.12.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.

Warning: Your Homebrew is outdated.
You haven't updated for at least 24 hours. This is a long time in brewland!
To update Homebrew, run `brew update`.

/usr/localの所有者と権限を変更するように表示されていますね。 About System Integrity Protection on your Mac - Apple Supportの影響でしょうか。 これもOS X El Capitanにアップグレードした時も同じでしたね。

こんな感じのコマンドを入力しました。

$ sudo chown -R $(whoami) /usr/local
$ brew doctor
$ brew update
$ brew cleanup -s
$ brew upgrade
$ brew cleanup -s

終わり

これを書いているHugoも普通に使えました。