Asdf: Homebrew setup instructions are incorrect

Created on 10 Jan 2019  路  14Comments  路  Source: asdf-vm/asdf

The setup instructions are incorrect - the Homebrew formula installs things a bit differently.
The paths (in case of Bash) are:

. /usr/local/opt/asdf/asdf.sh
. /usr/local/opt/asdf/etc/bash_completion.d/asdf.bash
help wanted

Most helpful comment

The issue @ttilberg linked to has helped me solve the same problem.

TLDR: put export ASDF_DIR=$(brew --prefix asdf) in your .bash_profile or .zshrc or whatever you are using.

All 14 comments

I tried installing asdf for the first time tonight, and it did not work (as this issue suggests). I was digging into it on my system and left some notes for someone who is more fluent in brewing (and/or this project).

https://github.com/asdf-vm/asdf/issues/428#issuecomment-455022420

Hopefully this is helpful for someone.

Same issue here, after running brew install asdf on Mojave 10.14.2, and before sourcing either script, running asdf outputs the following:

$ asdf
cat: /usr/local/VERSION: No such file or directory
version:

cat: /usr/local/help.txt: No such file or directory

The issue @ttilberg linked to has helped me solve the same problem.

TLDR: put export ASDF_DIR=$(brew --prefix asdf) in your .bash_profile or .zshrc or whatever you are using.

Note: If a homebrew user already has bash completion configured for homebrew (see: configuring-completions-in-bash), or has properly installed the bash-completion or bash-completion@2 package, sourcing the completions manually is unnecessary.

Is this still an ongoing issue?
If so, could a brew user be kind enough to send a PR with working instructions, please?
Thank you very much!

@danhper The way the docs are structured focuses on installation via Git. If I were to update the docs for this purpose, I'd be inclined to also add tabs to the Install asdf-vm section with Homebrew specific installation instructions, so that the instructions in Add to your Shell have a bit more context available.

Installing via Git would naturally not require Homebrew specific instructions, whether or not Homebrew is used.

Thoughts?

@dboune I agree with this. I suppose installing via Homebrew is a common choice for macOS user so having a dedicated section is, I think, a good idea.
However, it seems that docsify does not support nested tabs so I am not sure what is the best way to present this cleanly.

@danhper - I had the same thought, and indeed, no nested tabs :(

The only thing I can think of to keep the structure and not start branching pages is to either refer to the previous section, or make the assumption that the user will pick the appropriate tab as they go along.

There is a realistic chance that someone could come along wanting macOS + Homebrew + ZSH or FISH for example, and be willing to add it to the docs, so keeping the tabs for install instructions makes sense.

In Docsify, the first tab is the default selection, so in the Install asdf-vm section we could have two tabs, Git | Homebrew. I have been thinking of better ways to do this all than tabs, but requires a lot more work.

I鈥檒l be happy to go ahead and submit a PR just with simple tabs for the Install and Shell sections that includes the Homebrew instructions making the general assumption that folks will figure out which tabs are applicable to them.

If that鈥檚 worth the effort, let me know and I鈥檒l get it done.

@dboune I think most people will be able to figure it out.

The ideal solution I ultimately want is to get select boxes for OS, Shell and Install Method, but that will require a lot more work with Docsify or an alternate tool.

I'm in favour of fast iterations over perfection the first time. Feel free to ping me in subsequent PRs if there are immediate issues with this 馃槃

https://asdf-vm.com/#/core-manage-asdf-vm

To make homebrew's completions available in bash, you must source the definitions as part of your shell startup. They have to be in your PATH.

For me, on a Mac, this simply means running each of these commands
echo -e '\n. $(brew --prefix asdf)/asdf.sh' >> ~/.bash_profile
echo -e '\n. $(brew --prefix asdf)/etc/bash_completion.d/asdf.bash' >> ~/.bash_profile

The second command is unnecessary if you have configured completions for Homebrew in ~/.bash_profile

Homebrew bash configuration completion code:
https://docs.brew.sh/Shell-Completion#configuring-completions-in-bash

asdf install instructions for each system here:
https://asdf-vm.com/#/core-manage-asdf-vm

As I said in https://github.com/asdf-vm/asdf/issues/425#issuecomment-475999071

The ideal solution I ultimately want is to get select boxes for OS, Shell and Install Method, but that will require a lot more work with Docsify or an alternate tool.

we have updated the docs (https://asdf-vm.com/#/core-manage-asdf-vm) with select boxes to choose your setup and get just the information for your setup. Hope this helps

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rhiroyuki picture rhiroyuki  路  3Comments

gmile picture gmile  路  3Comments

peleteiro picture peleteiro  路  3Comments

robsonpeixoto picture robsonpeixoto  路  4Comments

Antiarchitect picture Antiarchitect  路  3Comments