asdf のインストール方法 [macOS編]

Tue, August 16, 2022 - 1 min read

M1 macOSにasdfをインストールする方法をご紹介します。

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 をインストールした、現場からお送りしました。