linuxoh-my-zshzshrcasdf-vm

Sourcing zshrc gives asdf error no plugin named completion


I noticed recently that when I run source ~/.zshrc, I get an error from the asdf version manager:

Unknown command: `asdf completion zsh`
No plugin named completion

I don't believe I changed anything recently. I am using oh-my-zsh and I am on the latest version. asdf is at v0.15.0-31e8c93.

In my .zshrc, I only have

plugins=(asdf)

as that is supposed to run the asdf.sh script for me.

The asdf tool itself is installed in $HOME/.asdf which is the default.

I think this has been working for a while although I don't remember the last time I sourced my .zshrc file.. Anyone know what's going on?


Solution

  • I faced the same error after upgrading oh-my-zsh to the latest commit (92da310). Upgrading asdf to v0.16.3 solved the issue for me.

    However, simply running asdf update did not solve the issue for me. asdf stopped working and all binaries installed with asdf also doesn't run. If you were using asdf in v0.15.x or before, you might need to follow this guide to upgrade instead: https://asdf-vm.com/guide/upgrading-to-v0-16.

    What worked for me on Ubuntu 22.04 is:

    1. Download the new v0.16.3 binary from https://github.com/asdf-vm/asdf/releases
    2. Add the binary to path
    3. Get the ASDF_DATA_DIR with asdf info
    4. Set the following in ~/.zshrc:
    export ASDF_DATA_DIR="/home/myuser/.asdf"
    export PATH="$ASDF_DATA_DIR/shims:$PATH"
    
    1. Regenerate Shims with asdf reshim