HomebrewをMacにインストールする

Node.jsのインストールに使おうと思うのでHomebrewをインストールする
nvmはCentOSでトラブったので止めておこう
HomebrewのインストールではDoctorに何点か警告をもらったのでコマンド出力もメモしておく

homebrewインストール

基本的に http://brew.sh/index_ja.html に従う

$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/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/.
/usr/local/include
/usr/local/lib
/usr/local/lib/pkgconfig
==> The following directories will have their group set to admin:
/usr/local/.
/usr/local/include
/usr/local/lib
/usr/local/lib/pkgconfig

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/. /usr/local/include /usr/local/lib /usr/local/lib/pkgconfig
Password:
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/. /usr/local/include /usr/local/lib /usr/local/lib/pkgconfig
==> /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: 190847, done.
remote: Compressing objects: 100% (51982/51982), done.
remote: Total 190847 (delta 137697), reused 190839 (delta 137692)
Receiving objects: 100% (190847/190847), 38.48 MiB | 475.00 KiB/s, done.
Resolving deltas: 100% (137697/137697), done.
From https://github.com/Homebrew/homebrew
 * [new branch]      master     -> origin/master
Checking out files: 100% (3290/3290), done.
HEAD is now at 29c7441 Set the remote config manually
==> Installation successful!
==> Next steps
Run `brew doctor` before you install anything
Run `brew help` to get started

Homebrewインストールに問題が無いか確認

$ 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 XQuartz (2.7.5) is outdated
Please install XQuartz 2.7.6:
  https://xquartz.macosforge.org

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
    /usr/local/lib/libmacfuse_i32.2.dylib
    /usr/local/lib/libmacfuse_i64.2.dylib
    /usr/local/lib/libosxfuse_i32.2.dylib
    /usr/local/lib/libosxfuse_i64.2.dylib

Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .la files:
    /usr/local/lib/libosxfuse_i32.la
    /usr/local/lib/libosxfuse_i64.la

Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
    /usr/local/lib/pkgconfig/osxfuse.pc

Homebrewインストール問題解決1

XQuartzをインストール

http://xquartz.macosforge.org/landing/ からダウンロードしてインストール

残問題確認

$ 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: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
    /usr/local/lib/libmacfuse_i32.2.dylib
    /usr/local/lib/libmacfuse_i64.2.dylib
    /usr/local/lib/libosxfuse_i32.2.dylib
    /usr/local/lib/libosxfuse_i64.2.dylib

Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .la files:
    /usr/local/lib/libosxfuse_i32.la
    /usr/local/lib/libosxfuse_i64.la

Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
    /usr/local/lib/pkgconfig/osxfuse.pc

Homebrewインストール問題解決2

警告ファイルを削除1

rm -f /usr/local/lib/libmacfuse_i32.2.dylib
rm -f /usr/local/lib/libmacfuse_i64.2.dylib
rm -f /usr/local/lib/libosxfuse_i32.2.dylib
rm -f /usr/local/lib/libosxfuse_i64.2.dylib

残問題確認

$ 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: Broken symlinks were found. Remove them with `brew prune`:
  /usr/local/lib/libfuse.0.dylib
  /usr/local/lib/libfuse.2.dylib
  /usr/local/lib/libfuse.dylib
  /usr/local/lib/libfuse_ino64.2.dylib
  /usr/local/lib/libfuse_ino64.dylib
  /usr/local/lib/libmacfuse_i32.dylib
  /usr/local/lib/libmacfuse_i64.dylib
  /usr/local/lib/libosxfuse.2.dylib
  /usr/local/lib/libosxfuse.dylib
  /usr/local/lib/libosxfuse_i32.dylib
  /usr/local/lib/libosxfuse_i64.dylib

Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .la files:
    /usr/local/lib/libosxfuse_i32.la
    /usr/local/lib/libosxfuse_i64.la

Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
    /usr/local/lib/pkgconfig/osxfuse.pc

警告ファイル削除で発生したリンク切れ解消1

$ brew prune
Pruned 0 dead formulae
Pruned 11 symbolic links from /usr/local

残問題確認

$ 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: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .la files:
    /usr/local/lib/libosxfuse_i32.la
    /usr/local/lib/libosxfuse_i64.la

Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
    /usr/local/lib/pkgconfig/osxfuse.pc

警告ファイルを削除2

rm -f /usr/local/lib/libosxfuse_i32.la
rm -f /usr/local/lib/libosxfuse_i64.la

残問題確認

$ 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: Broken symlinks were found. Remove them with `brew prune`:
  /usr/local/lib/libosxfuse.la

Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
    /usr/local/lib/pkgconfig/osxfuse.pc

警告ファイルを削除3

rm -f /usr/local/lib/pkgconfig/osxfuse.pc

残問題確認

$ 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: Broken symlinks were found. Remove them with `brew prune`:
  /usr/local/lib/libosxfuse.la
  /usr/local/lib/pkgconfig/fuse.pc

警告ファイル削除で発生したリンク切れ解消2

$ brew prune
Pruned 0 dead formulae
Pruned 2 symbolic links and 2 directories from /usr/local

残問題確認

$ brew doctor
Your system is ready to brew.

Homebrew Caskのインストール

関連ページ

$ brew install caskroom/cask/brew-cask
Cloning into '/usr/local/Library/Taps/caskroom/homebrew-cask'...
remote: Counting objects: 50443, done.
remote: Compressing objects: 100% (60/60), done.
remote: Total 50443 (delta 28), reused 2 (delta 0)
Receiving objects: 100% (50443/50443), 16.17 MiB | 135.00 KiB/s, done.
Resolving deltas: 100% (31127/31127), done.
Checking connectivity... done.
Checking out files: 100% (2123/2123), done.
Tapped 1 formula
==> Cloning https://github.com/caskroom/homebrew-cask.git
Cloning into '/Library/Caches/Homebrew/brew-cask--git'...
remote: Counting objects: 2106, done.
remote: Compressing objects: 100% (2059/2059), done.
remote: Total 2106 (delta 48), reused 448 (delta 36)
Receiving objects: 100% (2106/2106), 5.07 MiB | 205.00 KiB/s, done.
Resolving deltas: 100% (48/48), done.
Checking connectivity... done.
Note: checking out '99e75bddfdc1d9c8bc8f9d1a73a0e1dd7f0a2639'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

==> Checking out tag v0.39.3
    /usr/local/Cellar/brew-cask/0.39.3: 1906 files, 7.5M, built in 46 seconds

コマンドメモ

アップデート

brew update