Skip to content

asdf

asdf は 0.16 からディレクトリ構造が大幅に変化している

asdf は様々なランタイムを管理出来るバージョンマネージャです。 Golang で実装されています。 ただ、後発の Rust で実装された mise (旧名は rtx) は「asdf 用のプラグインは全て使えるが、asdf より速い」とうたっています。 これを受けてなのか、asdf は バージョン 0.16.0 の Changelog に下記の記載があります。 記載内容によると「バージョン 0.16.0 からより速く、シンプルで、メンテナンスし易いように書き直した」ようです。

Rewrite asdf in Golang The rewrite in Go was spread across 88 pull requests that are all included in this release. The primary goal of the rewrite was to create a codebase that was faster, simpler and easier to maintain. The rewrite tries to maintain feature parity with the previous version. However, a number of breaking changes were introduced. Some of these were due to the change of language, a few out of a desire to simplify the code, and some to improve the user experience. For the full list of breaking changes and the upgrade guide visit the Upgrading to 0.16.0 page on the asdf website. It is highly recommended that you read this guide before upgrading.

ですが、私の macOS 環境では 0.15 系から 0.16.1 へバージョンアップしたところ、下記のエラーが出るようになってしまいました。

/Users/USERNAME/.zshrc:.:10: no such file or directory: /opt/homebrew/opt/asdf/libexec/asdf.sh

.zshrc では バージョン 0.15 までのガイド に従って以下のように設定してありましたが、これがエラーになっているようです。

.zshrc
# asdf
. /opt/homebrew/opt/asdf/libexec/asdf.sh

Ubuntu 22.04 へ複数ユーザでの共有を前提に asdf をインストールする

以前に Ubuntu 24.04 へ asdf をインストールして言語 / ツールのバージョンを管理する というメモを書きました。 この過去メモでは相互に環境を汚染しないように「asdf をユーザ毎に分離して利用する」前提にしていました。 その為、以下の状態になります。

  • ユーザ A がインストールしたプラグインは、ユーザ A が利用出来る
  • ユーザ B がインストールしたプラグインは、ユーザ B が利用出来る
  • ユーザ A がインストールしたプラグインを、ユーザ B が利用することは出来ない

今回は複数ユーザでの共有することを前提に asdf をインストールする手順をメモしておきます。