1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

MacにHomebrewをインストールしていくつかパッケージを入れる

1
Last updated at Posted at 2020-12-14

Homebrewをインストールする準備

Command Line Tools for Xcode

====== 2022/12/15 追記 ======
M2 MBA macOS Ventura 13.0
iterm2を初回起動したら,command line toosのインストールが促されて,クリックしたらインストールされた
====== ====== ====== ======

HomebrewのインストールにはCommand Line Tools for Xcodeが必要.インストールする方法はいくつかある.

  1. gitなどのCommand Line Tools for Xcodeに入ってるコマンドを実行しようとすると自動的にインストールを促される.
  2. Appleのウェブサイトからダウンロード
  3. Xcode(容量大きい)をApp Storeからインストール
  4. 下記コマンドでインストール
$ xcode-select --install

Rosetta2を利用

====== 2022/12/16 追記 ======
もうrosettaで入れなくても良さそう
====== ====== ====== ======

現在(2020年12月)のところ,Armで動くHomebrewは公開されているもののまだ非推奨.まだArmに対応していないパケージなども色々あるので,当面はRosetta2を利用して今までと同じインテル用のものをインストールする.

Finderでアプリケーションディレクトリを開き,利用するターミナルアプリを右クリックして情報を見るRosettaを使用して開くにチェックを入れておく.

その後ターミナルを起動するとRosetta2を使用した状態になる.ターミナルを開いてuname -mと打ち込んでx86_64と表示されればOK.

$ uname -m
x86_64

Homebrewのインストール

ターミナルから下記コマンドを実行するだけ.

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

ターミナルを新しく起動し直すとpathが自動的に通っているはず.

====== 2022/12/16 追記 ======
Arm版ではpathの設定が必要.インストールが終わると

==> Next steps:
- Run these three commands in your terminal to add Homebrew to your PATH:
    echo '# Set PATH, MANPATH, etc., for Homebrew.' >> /Users/yamashita06/.zprofile
    echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/yamashita06/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"

と表示されるので,上記3つを実行するだけ
====== ====== ====== ======

zshのエラー

Homebrewを入れたらターミナルを起動したログイン時に下記のエラーが出るようになった.

zsh compinit: insecure directories, run compaudit for list.
Ignore insecure directories and continue [y] or abort compinit [n]?

セキュアじゃないディレクトリがあるらしい.言われた通りにcompauditコマンドを実行してみる.

$ compaudit
There are insecure directories:
/usr/local/share/zsh/site-functions
/usr/local/share/zsh

ググってみるとここに解決方法が載っていた.
macでzshでzsh compinit: insecure directoriesの警告が出る問題

上記二つのディレクトリにおいて,自分以外のユーザーも書き込み権限を持ってるのが原因らしい.パーミッションを変更しておく.

Homebrewを入れたらインストールしておくパッケージ

自分のためのメモ.

Ricty

プログラミングに最適なフォントRictyのインストール

$ brew tap sanemat/font
$ brew install ricty

インストールすると最後の方に,

To install Ricty:
  $ cp -f /usr/local/opt/ricty/share/fonts/Ricty*.ttf ~/Library/Fonts/
  $ fc-cache -vf

と表示されるので,言われた通りにやるとインストールできる.

$ cp -f /usr/local/opt/ricty/share/fonts/Ricty*.ttf ~/Library/Fonts/
$ fc-cache -vf
1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?