at backyard

Color my life with the chaos of trouble.

macOSのbrewコマンドでnkfをインストールした際に、link周りでエラーになったときの対応メモ。備忘録。

macを扱っているとき、ファイルの文字コード変換周りでよくお世話になっていたnkfコマンド。

以前はそのままインストール出来たような記憶があるが、今回はインストールに少し躓いたので、備忘録として書いておく。

普段どおり、下記のコマンドでインストールしようとすると、

brew install nfk

下記のようなエラーが出た。

Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink share/man/ja/man1/nkf.1
/usr/local/share/man/ja/man1 is not writable.

そのため、権限周りを下記のコマンドを打って変更した。

sudo chmod 775 /usr/local/share/man/ja/man1
sudo chown <ユーザ名>:admin /usr/local/share/man/ja/man1

最後に下記コマンドを打って、無事に使えるようになった。

brew link nkf

参照ページ

下記のページを参考にさせていただいた。

blog.kozakana.net