macOS で asdf をアンインストールし、mise をインストールする
新規に Linux などの環境を構築する場合はバージョン管理に mise を使っているのですが、手元の作業用 macOS は asdf のままでした。 今更ですが、手元の作業用 macOS も mise に統一すべく、asdf をアンインストールして mise をインストールする手順をメモしておきます。
検証環境¶
対象 | バージョン |
---|---|
macOS | Sequoia 15.4.1 |
mise | 2025.5.1 macos-arm64 (2025-05-05) |
asdf のアンインストール¶
asdf は Homebrew でインストールしていました。
% brew info asdf
==> asdf: stable 0.16.7 (bottled), HEAD
Extendable version manager with support for Ruby, Node.js, Erlang & more
https://asdf-vm.com/
Installed
/opt/homebrew/Cellar/asdf/0.16.7 (15 files, 11.4MB) *
Poured from bottle using the formulae.brew.sh API on 2025-03-28 at 21:04:08
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/a/asdf.rb
License: MIT
==> Dependencies
Build: go ✘
==> Options
--HEAD
Install HEAD version
==> Caveats
zsh completions have been installed to:
/opt/homebrew/share/zsh/site-functions
==> Analytics
install: 12,010 (30 days), 60,181 (90 days), 146,537 (365 days)
install-on-request: 12,006 (30 days), 60,159 (90 days), 146,480 (365 days)
build-error: 10 (30 days)
まず ~/.zshrc
から以下を削除します。
export PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH"
Homebrew で asdf をアンインストールします。
brew uninstall asdf
mise のインストール¶
mise も Homebrew で提供されています。
% brew info mise
==> mise: stable 2025.5.1 (bottled), HEAD
Polyglot runtime manager (asdf rust clone)
https://mise.jdx.dev/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/m/mise.rb
License: MIT
==> Dependencies
Build: pkgconf ✘, rust ✘
Required: usage ✘
==> Options
--HEAD
Install HEAD version
==> Caveats
If you are using fish shell, mise will be activated for you automatically.
==> Analytics
install: 28,793 (30 days), 86,970 (90 days), 222,475 (365 days)
install-on-request: 28,745 (30 days), 86,674 (90 days), 221,491 (365 days)
build-error: 1 (30 days)
Homebrew でインストールします。
brew install mise
作業ログ
% brew install mise
==> Downloading https://formulae.brew.sh/api/formula.jws.json
==> Downloading https://formulae.brew.sh/api/cask.jws.json
==> Downloading https://ghcr.io/v2/homebrew/core/mise/manifests/2025.5.1
##################################################################################################################################################### 100.0%
==> Fetching dependencies for mise: usage
==> Downloading https://ghcr.io/v2/homebrew/core/usage/manifests/2.1.1
##################################################################################################################################################### 100.0%
==> Fetching usage
==> Downloading https://ghcr.io/v2/homebrew/core/usage/blobs/sha256:48749a36fe6f537c4fe3e123d21627fd4b25ff38609d4d24cc81f1fad83ea000
##################################################################################################################################################### 100.0%
==> Fetching mise
==> Downloading https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:4128d4efd5bda5d17402d6f16b5568848ff01bf684510c56e67d4be705937dba
##################################################################################################################################################### 100.0%
==> Installing dependencies for mise: usage
==> Installing mise dependency: usage
==> Downloading https://ghcr.io/v2/homebrew/core/usage/manifests/2.1.1
Already downloaded: /Users/USERNAME/Library/Caches/Homebrew/downloads/db23878a39276a42ad760b022644fa4fe5a58fa193499a20854f340633d8dd41--usage-2.1.1.bottle_manifest.json
==> Pouring usage--2.1.1.arm64_sequoia.bottle.tar.gz
🍺 /opt/homebrew/Cellar/usage/2.1.1: 9 files, 8.2MB
==> Installing mise
==> Pouring mise--2025.5.1.arm64_sequoia.bottle.tar.gz
==> Caveats
If you are using fish shell, mise will be activated for you automatically.
zsh completions have been installed to:
/opt/homebrew/share/zsh/site-functions
==> Summary
🍺 /opt/homebrew/Cellar/mise/2025.5.1: 15 files, 37.5MB
==> Running `brew cleanup mise`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Caveats
==> mise
If you are using fish shell, mise will be activated for you automatically.
zsh completions have been installed to:
/opt/homebrew/share/zsh/site-functions
~/.zshrc
へ以下を追記します。
echo 'eval "$(mise activate zsh)"' >> ~/.zshrc
これでシェルを再起動すれば mise が利用出来るようになります。
Python の仮想環境を作成するスクリプト¶
Python の仮想環境を作成するスクリプトを用意しておきます。 /usr/local/bin/venv
を以下の内容で保存します。 mise.toml
ファイルを作成した後、46 行目で mise trust
を実行しています。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
権限と所有者を修正しておきます。
sudo chmod 755 /usr/local/bin/venv
sudo chown root:wheel /usr/local/bin/venv