asdf のインストール [M1 macOS 編]
M1 macOS に asdf をインストールする方法をご紹介します。
前提条件
- CPU: M1
- OS: macOS Monterey 12.5.1
- Shell: zsh
asdf のダウンロード
公式ドキュメント Getting Started | asdf を参考に asdf
のダウンロードとインストールを進めます。
brew install asdf
asdf.sh のインストール
以下のいずれかの方法で asdf.sh
を .zshrc
へ追記しましょう。
echo -e
でワンライナーコマンド実行
echo -e "n. $(brew --prefix asdf)/libexec/asdf.sh" >> ~/.zshrc
.zshrc
を直接編集
brew install asdf
の最後に表示される
To use asdf, add the following line to your ~/.zshrc:
. /opt/homebrew/opt/asdf/libexec/asdf.sh
のメッセージの通り ~/.zshrc
へ
. /opt/homebrew/opt/asdf/libexec/asdf.sh
を追記する。
以上、M1 macOS に asdf をインストールした、現場からお送りしました。