asdf-ruby icon indicating copy to clipboard operation
asdf-ruby copied to clipboard

Updating Package does not update new Ruby Versions list

Open SheW0lf opened this issue 7 months ago • 7 comments

I use this plugin to manage my ruby versions, and a repo I constantly work in just updated to ruby 3.4.3. I ran asdf plugin update ruby per the docs, but then when I ran asdf list all ruby | grep 3.4 I got this:

1.8.7-p334
1.8.7-p374
1.9.3-p374
2.3.4
3.3.4
3.4.0-preview1
3.4.0-preview2
3.4.0-rc1
3.4.0
3.4-dev
3.4.1
3.4.2
jruby-9.3.4.0
rbx-3.4
rbx-3.40
rbx-3.41
rbx-3.42
rbx-3.43
rbx-3.44
rbx-3.45
rbx-3.46
rbx-3.47
rbx-3.48
rbx-3.49

No 3.4.3 in the list. After about 30 mins of troubleshooting, I decided to uninstall and re-install the plugin and now I see 3.4.3 in the list. So it appears that the asdf plugin update ruby does not actually update the ruby versions that are available for download.

SheW0lf avatar Apr 21 '25 22:04 SheW0lf

I'm hitting the same issue and for some reason the ASDF_RUBY_BUILD_VERSION in ~/.asdf/plugins/ruby/lib/utils.sh is downgraded? I didn't do this manually:

~/.asdf/plugins/ruby/ruby-build (git)-[master] % git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	modified:   ../lib/utils.sh
~/.asdf/plugins/ruby/ruby-build (git)-[master] % git diff --cached
diff --git a/lib/utils.sh b/lib/utils.sh
index 31d322e..aa9be9b 100644
--- a/lib/utils.sh
+++ b/lib/utils.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash

-RUBY_BUILD_VERSION="${ASDF_RUBY_BUILD_VERSION:-v20250418}"
+RUBY_BUILD_VERSION="${ASDF_RUBY_BUILD_VERSION:-v20250409}"
 RUBY_BUILD_TAG="$RUBY_BUILD_VERSION"

 echoerr() {

~/.asdf/plugins/ruby (git)-[master] % git restore --staged lib/utils.sh fixed it.

rnestler avatar Apr 23 '25 07:04 rnestler

I'm hitting the same issue and for some reason the ASDF_RUBY_BUILD_VERSION in ~/.asdf/plugins/ruby/lib/utils.sh is downgraded? I didn't do this manually:

~/.asdf/plugins/ruby/ruby-build (git)-[master] % git status On branch master Your branch is up to date with 'origin/master'.

Changes to be committed: (use "git restore --staged ..." to unstage) modified: ../lib/utils.sh ~/.asdf/plugins/ruby/ruby-build (git)-[master] % git diff --cached diff --git a/lib/utils.sh b/lib/utils.sh index 31d322e..aa9be9b 100644 --- a/lib/utils.sh +++ b/lib/utils.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash

-RUBY_BUILD_VERSION="${ASDF_RUBY_BUILD_VERSION:-v20250418}" +RUBY_BUILD_VERSION="${ASDF_RUBY_BUILD_VERSION:-v20250409}" RUBY_BUILD_TAG="$RUBY_BUILD_VERSION"

echoerr() { ~/.asdf/plugins/ruby (git)-[master] % git restore --staged lib/utils.sh fixed it.

Exactly, the solution was to hard reset back and pull the latest changes. Now it works fine

serg-kovalev avatar Apr 23 '25 10:04 serg-kovalev

I'm seeing the same dirty state in the plugin folder after running asdf plugin update ruby. What version of asdf are you all using? I saw this behavior with 0.16.7.

I suspect it's an asdf issue, rather than a Ruby plugin issue, but I don't know enough about the inner workings to know for sure.

juanpaco avatar Apr 24 '25 22:04 juanpaco

Same problem here - seems like this is a real issue for everybody. Also using 0.6.17 of asdf via homebrew.

dup2 avatar Apr 25 '25 07:04 dup2

Same problem over here. I'm also using asdf 0.16.7.

rnestler's suggestion fixed it :)

kreintjes avatar Apr 30 '25 11:04 kreintjes

This fixed it for me:

$ rm -r ~/.asdf/installs/ruby/3.4.3
$ ASDF_RUBY_BUILD_VERSION=master asdf install ruby 3.4.3

MatheusRich avatar May 09 '25 20:05 MatheusRich

I'm hitting the same issue and for some reason the ASDF_RUBY_BUILD_VERSION in ~/.asdf/plugins/ruby/lib/utils.sh is downgraded? I didn't do this manually:

~/.asdf/plugins/ruby/ruby-build (git)-[master] % git status On branch master Your branch is up to date with 'origin/master'.

Changes to be committed: (use "git restore --staged ..." to unstage) modified: ../lib/utils.sh

~/.asdf/plugins/ruby/ruby-build (git)-[master] % git diff --cached diff --git a/lib/utils.sh b/lib/utils.sh index 31d322e..aa9be9b 100644 --- a/lib/utils.sh +++ b/lib/utils.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash

-RUBY_BUILD_VERSION="${ASDF_RUBY_BUILD_VERSION:-v20250418}" +RUBY_BUILD_VERSION="${ASDF_RUBY_BUILD_VERSION:-v20250409}" RUBY_BUILD_TAG="$RUBY_BUILD_VERSION"

echoerr() {

~/.asdf/plugins/ruby (git)-[master] % git restore --staged lib/utils.sh fixed it.

This worked for me. Is it possible one or more the following .gitconfig options could be related to the issue, e.g. by unexpectedly stashing/popping a change onto the updated ruby-build branch? Do others experiencing this have these in their config as well?

[merge]
	autostash = true
[pull]
	rebase = true
[rebase]
	autostash = true

eizengan avatar May 28 '25 18:05 eizengan

It seems that asdf should at least output some kind of error when there are staged changes in a plugin and you're running update

exterm avatar Jul 28 '25 16:07 exterm