Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

with_shim_executable: command not found #730

Closed
DamianRivas opened this issue May 20, 2020 · 10 comments
Closed

with_shim_executable: command not found #730

DamianRivas opened this issue May 20, 2020 · 10 comments
Assignees
Labels

Comments

@DamianRivas
Copy link

DamianRivas commented May 20, 2020

Describe the bug

I installed deno v1.0.0 using asdf and this plug-in: https://github.com/asdf-community/asdf-deno

I get an error when trying to run deno

To Reproduce

All I did was run this exact command in the terminal

deno

Expected behavior

The deno runtime should've run.

Actual behavior

I got this error

➜  Damian deno
/home/damianrivas/.asdf/lib/commands/command-exec.bash: line 31: with_shim_executable: command not found
➜  Damian

Environment

OS: Ubuntu 18.04 in Windows Subsystem for Linux

asdf version: v0.7.8-4a3e3d6

asdf plugins affected (if relevant):

asdf plugins installed:

https://github.com/asdf-community/asdf-deno

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context

I looked at the source file identified in the error and went from there. I discovered that with_shim_executable is a function written in utils.bash in the asdf source.

I use ZSH if that matters.

@jthegedus
Copy link
Contributor

I am unable to reproduce this with this setup:

operating system: ubuntu 20.04
asdf --version: v0.7.8-d652835
asdf plugin list --refs | grep deno: deno master 3860217

Can you please verify that this only happens for a single plugin?

@DamianRivas
Copy link
Author

It is the only plug-in I have installed. This is the first time I ever use asdf and deno is the first and only software I installed with it

@jthegedus
Copy link
Contributor

@DamianRivas Can you install another plugin, say nodejs and see if you get the same result. It will help us narrow down whether it is an error in the plugin or in the asdf core.

@ryuheechul
Copy link

In my case, this happened after brew upgrade asdf failed on macbook running with Big Sur.
Which I was able to fix the issue by Homebrew/brew#7803 (comment) and reinstalling.

@jthegedus
Copy link
Contributor

@ryuheechul So is this issue still present, or was it specifically Homebrew and BigSur related?

@ryuheechul
Copy link

ryuheechul commented Aug 20, 2020

@jthegedus I believe this is a macOS issue that can be dealt with by installing developer tools provided by Apple. However I think people could still be confused by the error when they first discover this, although I'm not sure what can be done in asdf's side.

@jthegedus
Copy link
Contributor

Right, Brew depends on a macOS developer tools - https://docs.brew.sh/Installation#macos-requirements

Homebrew never works as smoothly for me as it does others 🤷

@DamianRivas I'm tracking this change alongside other WSL issues in #465

@Stratus3D
Copy link
Member

@ryuheechul @DamianRivas can you test this on the latest version of asdf? v0.9.0 was just released.

@DamianRivas
Copy link
Author

@Stratus3D It's been a while. I use zsh + oh-my-zsh and installed it the way I think the documentation intends for us to do so. I cloned the repo this way

git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.9.0

And I added the plugin to my .zshrc file: plugins=(git asdf)

But when I start a new terminal I see this:

/home/damianrivas/.asdf/completions/asdf.bash:80: command not found: complete

complete is a bash builtin, there is no binary for it so that error makes sense given that I'm a zsh user. Still, not very user friendly. I feel like that is something that should work out of the box.


Anyway, that's just the autocomplete feature, but the asdf command itself works. And I'm happy to report that installing deno was quick, easy, and painless!

➜  ~ asdf install deno latest
∗ Downloading and installing deno...
Archive:  /home/damianrivas/.asdf/installs/deno/1.16.3/bin/deno.zip
  inflating: /home/damianrivas/.asdf/installs/deno/1.16.3/bin/deno
The installation was successful!
➜  ~ asdf current
deno            ______          No version is set. Run "asdf <global|shell|local> deno <version>"
➜  ~ asdf global deno latest
➜  ~ cat ~/.tool-versions
deno 1.16.3
➜  ~ which deno
/home/damianrivas/.asdf/shims/deno
➜  ~ deno
Deno 1.16.3
exit using ctrl+d or close()
>

And yes, this was done in WSL.

I may give this tool a solid chance now, but I really don't like that message that pops up every time I start up a new terminal window.

@jthegedus
Copy link
Contributor

The OMZSH plugin for asdf uses the Bash completions not the ZSH completions. This particular issue command not found: complete has been covered a few times in this repo:

Recommendations are one of:

  • use ZSH native completions with ZSH compinit
     # append completions to fpath 
     fpath=(${ASDF_DIR}/completions $fpath) 
    
     # initialise completions with ZSH's compinit 
     autoload -Uz compinit && compinit
    
  • run bashcompinit after you source the OMZSH bash-completion-based plugin
     autoload -U +X bashcompinit && bashcompinit
    

Unfortunately, automatically running compinit/bashcompinit in the completion script is not an option.

I am going to close this as a solution is known and the latest documentation walks the user through the setup process to avoid this with a warn of external plugins not being updated accordingly.

image
source - https://asdf-vm.com/guide/getting-started.html#_3-install-asdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants