LoginSignup
43
44

More than 5 years have passed since last update.

Homebrew をインストールして使えるようになるまで 〜私の場合〜

Posted at

Mac環境:OSX Yosemite 10.10.1

Golang の開発環境を作成するために、
まず Homebrew をインストールすることになりました。(元記事はこちら

0. 前準備〜参考サイト〜

下記サイトが、とても参考になりましたよ。Qiita素晴らしす!
http://qiita.com/b4b4r07/items/6efebc2f3d1cbbd393fc

Homebrew の公式サイトはこちら。日本語版もあった〜すげぇ。
http://brew.sh/index_ja.html

上記の記事(主にQiitaの方)を参考に、
以下、私が行ったインストール手順を紹介します。

1. Java を確認する

まず、Java の確認。

ターミナル
$ java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)

Java はOK。

2. Xcode を確認する

Xcode の確認。

ターミナル
$ xcode-select --install
xcode-select: note: install requested for command line developer tools

Xcode なかったっぽい。

そしたらご親切に、UIがでてきて「Xcodeをインストールするかい?」って聞かれたので、
素直にインストールボタンをぽっちり。ダウンロードとインストールが始まる。

うちの回線がクソなので、ダウンロードを待ってる間に寝てたら、
どうもインストールまでいつの間にか完了してた模様。

ターミナル
$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates

怒られた。すみません。Xcode もOK。

3. Homebrew をインストールする

ついに、Homebrew 本体のインストールだよ!

ちなみに、root権限で実行しようとすると、ちゃんと怒られますw
バカにも優しい・・・。

ターミナル
$ sudo ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Password:(パスワード入力)
Don't run this as root!

賢い子は自分のユーザで実行しましょう。

ターミナル
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
==> The following directories will be made group writable:
/usr/local/.
==> The following directories will have their group set to admin:
/usr/local/.

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/.
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/.
==> /usr/bin/sudo /bin/mkdir /Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
==> Downloading and installing Homebrew...
remote: Counting objects: 220187, done.
remote: Compressing objects: 100% (58029/58029), done.
remote: Total 220187 (delta 160945), reused 220153 (delta 160921)
Receiving objects: 100% (220187/220187), 49.78 MiB | 116.00 KiB/s, done.
Resolving deltas: 100% (160945/160945), done.
From https://github.com/Homebrew/homebrew
 * [new branch]      master     -> origin/master
HEAD is now at de0282d Remove unnecessary code from debugger
==> Installation successful!
==> Next steps
Run `brew doctor` before you install anything
Run `brew help` to get started

ん、インストールできた!

では、仕上げのコマンドをば、打ち込みましょうかね。

ターミナル
$ brew doctor
Your system is ready to brew.

MacPorts などがすでに存在していると、エラーがでるようですが、
私は何も入っていなかったので、問題なかったようです。

無事、Homebrew インストール完了!

ちゃんちゃん。

以上

43
44
3

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
43
44