11
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Mac SierraにHomebrew + Cask + Versionsを導入する方法

Last updated at Posted at 2016-11-08

ちょっと訳あってbrew周りを整理したく、一旦まっさらな状態にしたかった時の備忘録。

Homebrewインストール

アンインストール & インストール

  • 既にHomebrewを入れてある場合、一旦アンインストール。

    先にrubyをunlinkしているが、これをやらずに無邪気にアンインストールを行うと、brewで入れたrubyへのシンボリックリンク先が存在せず、インストール実行時に困ってしまう。

    console
    brew unlink --force ruby
    sudo ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
    
  • homebrewをインストール。

    先述の通り、無邪気に既存のbrewを消してしまった場合も考慮し、rubyはMacに標準で入っているrubyをフルパスで指定。

    console
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    

確認

  • version

    console
    brew --version
    (結果)
    Homebrew 1.1.0
    Homebrew/homebrew-core (git revision 1a39; last commit 2016-11-07)
    
  • help

    console
    brew help
    
    (結果)
    Example usage:
      brew search [TEXT|/REGEX/]
      brew (info|home|options) [FORMULA...]
      brew install FORMULA...
      brew update
      brew upgrade [FORMULA...]
      brew uninstall FORMULA...
      brew list [FORMULA...]
    
    Troubleshooting:
      brew config
      brew doctor
      brew install -vd FORMULA
    
    Developers:
      brew create [URL [--no-fetch]]
      brew edit [FORMULA...]
      https://github.com/Homebrew/brew/blob/master/docs/Formula-Cookbook.md
    
    Further help:
      man brew
      brew help [COMMAND]
      brew home
    

Homebrew Caskをインストール

Homebrewでインストールできるパッケージを拡張する。
yum repositoryみたいなもの?

インストール

  • 以下のコマンドを実行してインストール

    console
    brew install caskroom/cask/brew-cask
    

    Xcode can be updated from the App Store.っておこられたら、xcodeアップデート&起動してライセンス承認しましょう。
    30分くらいかかるかも…。

  • 確認

    console
    brew cask --version
    
    (結果)
    Homebrew-Cask 1.1.0
    caskroom/homebrew-cask (git revision 84d2; last commit 2016-11-08)
    

Homebrew Versionsを導入

Cask上には複数のバージョンのパッケージが登録されていることがあるため、バージョンを指定してインストールすることが可能になるhomebrew-versionsを導入する。

導入

  • brew tapでインストール

    console
    brew tap caskroom/versions
    

確認

  • tap内容を確認

    ls /usr/local/Homebrew/Library/Taps/caskroom
    
    (結果)
    homebrew-cask		homebrew-versions
    
11
14
0

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
11
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?