Asdf assuming that ruby version is installed while it's not
I am getting this output after changing the ruby version directly on .tool-versions to 3.2.8 and attempting to install it:
❯ cat .tool-versions | grep ruby
ruby 3.2.8
❯ asdf info
OS:
Darwin mac.local 24.3.0 Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:23 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T8122 arm64
SHELL:
zsh 5.9 (arm64-apple-darwin24.0)
BASH VERSION:
3.2.57(1)-release
ASDF VERSION:
v0.16.3
ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/Users/me/.asdf
ASDF_CONFIG_FILE=/Users/me/.asdfrc
ASDF INSTALLED PLUGINS:
golang https://github.com/asdf-community/asdf-golang.git e2527a31714da7bc671a684308579f4ef8863281
just https://github.com/olofvndrhr/asdf-just.git 3f907ee4ca331e5caf9768b33137fcf9f752f8f1
nodejs https://github.com/asdf-vm/asdf-nodejs.git 93bd217ba74f05080eebb7d8e1c146a385b01d7f
python https://github.com/danhper/asdf-python.git a3a01856098d6d2b9642e382f5b38e70275726d1
ruby https://github.com/asdf-vm/asdf-ruby.git 2ee0bdf918cb22feda32f421a58edf3ca868f290
rust https://github.com/code-lever/asdf-rust.git 95acf4fe65df1de74fca502482b8f3ac5af73c05
❯ asdf install ruby 3.2.8
version 3.2.8 of ruby is already installed
❯ ruby -v
No version is set for command ruby
Consider adding one of the following versions in your config file at /Users/me/another/repo/.tool-versions
ruby 3.3.4ruby 3.2.7ruby 3.2.6%
❯ asdf current
Name Version Source Installed
golang 1.24.0 /Users/me/.tool-versions true
just 1.39.0 /Users/me/.tool-versions true
nodejs 20.19.0 /Users/me/.tool-versions true
python 3.13.1 /Users/me/.tool-versions true
ruby 3.2.8 /Users/me/another/repo/.tool-versions true
rust 1.84.1 /Users/me/.tool-versions true
This was fixed by fully removing and installing the plugin.
I may have just run into the same thing. The issue was that the directory for the Ruby version was there, but it was empty. Removing the directory and running asdf install fixed it
This is on an M series Mac with asdf version 0.16.4, going from Ruby 3.4.2 to 3.4.3 in .tool-versions
The cause of this is in asdf core, not in this plugin. asdf creates the install directory before it runs the plugin's install script. In asdf versions before 0.16.6, a failed install script leaves that empty directory behind. A later asdf install sees the directory and reports "already installed", and asdf reshim finds no binaries in it.
One way to trigger it: run asdf install ruby <new version> before asdf plugin update ruby. The plugin stops with "Version not found" and the empty directory stays.
asdf has fixed this:
- v0.16.6 (asdf-vm/asdf#2024): asdf removes the install directory when the
installscript fails. - v0.20.2 (asdf-vm/asdf#2303): asdf marks each install as incomplete until it succeeds, and it removes a stale incomplete directory on the next install. This also covers failures in the download step and interrupted installs.
To fix it, upgrade asdf to v0.20.2 or later (brew upgrade asdf if you installed asdf with Homebrew). Then delete any empty directory that the old version left behind and install again:
rmdir ~/.asdf/installs/ruby/<version>
asdf install ruby <version>
I think this issue can be closed.