2016年5月8日日曜日

Homebrewをインストールする

OS X 10.11 El CapitanがインストールされたMacBook Proを使ってます。
Rubyはインストール済みですが、Homebrewをインストールして、Rubyのバージョンを管理します。

あらかじめ、Xcodeコマンドラインツールをインストールしておきました。
※最近はHomebrewのインストールと併せて自動でインストールされるらしいですが、僕は未確認。

GUI版Xcodeはインストールサイズがでかいので、コマンドラインツールのみインストールします。

・https://developer.apple.com/downloads/index.action にアクセス。
・Apple IDの認証を求められますが、Macユーザーなら持っているでしょう。
・リストが出てくるので Command Line Tools を選択しダウンロード。
・ダウンロードしたらインストール作業を行う。

Homebrewのインストールは、ターミナルを立ち上げて、次のコマンド一発です。
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

インストールが終わったら、念のためにバージョンを確認してみます。
$ brew -v
Homebrew 0.9.9 (git revision d887; last commit 2016-05-06)
Homebrew/homebrew-core (git revision ee6e; last commit 2016-05-07)

さらにHomebrewに問題ないか、確認してみます。
 $ brew doctor
Your system is ready to brew.

上記メッセージが出たら、Homebrewのインストールは成功です。

ちなみに、$ brew doctorではこんな警告が出る場合があります。
 $ 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: 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`.

こういうときは、説明通り、$ brew update を行ってやります。

0 件のコメント:

コメントを投稿