asdf-vm / asdf

Extendable version manager with support for Ruby, Node.js, Elixir, Erlang & more
https://asdf-vm.com/
MIT License
22.07k stars 785 forks source link

bug: asdf current <tool> is not report correctly #1696

Open jiz4oh opened 11 months ago

jiz4oh commented 11 months ago

Describe the Bug

The asdf current is not return correctly if some of specify versions are not installed, I have the following line in .tool-versions:

ruby 2.7.8 2.6.10 system

I have installed 2.7.8 and haven't installed 2.6.10, and the ruby --version is correctly return

ruby 2.7.8p225 (2023-03-30 revision 1f4d455848) [arm64-darwin21]

but asdf current ruby return

ruby            system          Not installed. Run "asdf install ruby system"

at least it should show me 2.7.8 instead of system

Steps to Reproduce

  1. add some additional versions on .tool-versions, like ruby 3.2.2 2.5.4 system
  2. run asdf current ruby

Expected Behaviour

2.7.8

Actual Behaviour

ruby system Not installed. Run "asdf install ruby system"

Environment

OS:
Darwin C02F90VJQ05R-ALEX 21.6.0 Darwin Kernel Version 21.6.0: Mon Apr 24 21:11:35 PDT 2023; root:xnu-8020.240.18.701.5~1/RELEASE_ARM64_T8101 arm64

SHELL:
zsh 5.8.1 (x86_64-apple-darwin21.0)

BASH VERSION:
3.2.57(1)-release

ASDF VERSION:
v0.13.1-0586b37

ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/Users/jiz4oh/.asdf
ASDF_DIR=/Users/jiz4oh/.asdf
ASDF_CONFIG_FILE=/Users/jiz4oh/.asdfrc

ASDF INSTALLED PLUGINS:
deno                         https://github.com/asdf-community/asdf-deno.git master 87442fe
golang                       https://github.com/asdf-community/asdf-golang.git master 33b1f6d
nodejs                       https://github.com/asdf-vm/asdf-nodejs.git master c9e5df4
python                       https://github.com/danhper/asdf-python.git master 8505457
ruby                         https://github.com/asdf-vm/asdf-ruby.git master b3d44de

asdf plugins affected (if relevant)

No response

jthegedus commented 10 months ago

Is this resolved by running asdf reshim ruby?

jiz4oh commented 10 months ago

No. And I update the Steps to Reproduce that can easily reproduce