オフィシャルサイト より
Homebrew is the easiest and most flexible way to install the UNIX tools Apple didn’t include with OS X. [homebrew.official]
以下の環境が必要。てなわけで、事前に Apple Developer Tools をインストールしておくこと。
- そもそも、まっさらな状態のOS X って、 /usr/local フォルダが無い。あるっていうことは、何らかのパッケージ mac ports? を入れた後の状況なので、ぶつかるよねって話かな。
- でもこんなことしちゃうと、マルチユーザ環境では困るよね。
こんだけ。ちなみに、ruby はOS Xにプレインストールされている。 あと、Xcodeのinstallはこの前でも、後でもOK。
$ ruby -e "$(curl -fsSLk https://gist.github.com/raw/323731/install_homebrew.rb)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/Formula/...
/usr/local/Library/Homebrew/...
Press enter to continue
==> /usr/bin/sudo /bin/mkdir /usr/local
WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.
To proceed, enter your password, or type Ctrl-C to abort.
Password:
==> /usr/bin/sudo /bin/chmod g+w /usr/local
==> /usr/bin/sudo /usr/bin/chgrp staff /usr/local
==> Downloading and Installing Homebrew...
==> Installation successful!
とりあえず、たとえば git を入れたい場合は
$ brew install git
| コマンド | 処理内容 |
|---|---|
| brew install hoge | hoge を install |
| brew fetch –force -v –HEAD foo | foo の最新Sourceだけダウンロード |
| brew remove foo | foo を uninstall |
| brew search | 全パッケージのリスト |
| brew search foo | fooをさがす |
| brew search /foo/ | 正規表現でさがす |
| brew list | install 済みパッケージ一覧 |
| brew list foo | install 済みからfooを探す |
| brew info | install 済み情報サマリ |
| brew info –github foo | ブラウザで info を表示 |
| brew update | homebrew の formulae と自身をupdate |
| brew upgrade | install 済みパッケージのアップデート |
| brew –prefix | インストールされているpathを表示 |
脚注
| [1] | Homebrew オフィシャルサイト |
| [2] | KOSHIGOE学習帳 - [system][osx] Homebrew |
| [3] | Installation - GitHub |
| [4] | The brew command |