asdf: `asdf help` does not work with Homebrew installation
Steps to reproduce
brew install asdf
asdf
orasdf help
Expected behavior
Should list help text for asdf
Actual behavior
cat: /usr/local/VERSION: No such file or directory
version:
cat: /usr/local/help.txt: No such file or directory
"Late but latest"
-- Rajinikanth
Environment
OS: macOS 10.14.6
asdf version: 0.75
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 22
- Comments: 22 (13 by maintainers)
Commits related to this issue
- fix from https://github.com/asdf-vm/asdf/issues/607\#issuecomment-799092711 — committed to cocoa-xu/evision by cocoa-xu a year ago
- Using asdf (#199) * using asdf * cannot use macos-12-xl :( * fix from https://github.com/asdf-vm/asdf/issues/607\#issuecomment-799092711 * source * ignore warnings for now — committed to cocoa-xu/evision by cocoa-xu a year ago
@januswel Thanks for reporting.
Your reproduction doesn’t follow all of the
asdf
setup instructions. Namely, you need to add asdf to your shell as well.Can you confirm this occurs after all the setup steps are complete?
Thank you @jthegedus It works after adding
. $(brew --prefix asdf)/asdf.sh
@jthegedus
It’s very nice!! I have added some changes to show install instructions for the Homebrew formula
https://github.com/Homebrew/homebrew-core/pull/54315
Feel free to close and create another PR to improve in your way 🙇
you don’t need to restart the shell (for those of you have like 20 open)
just include this line
into your .*rc file (I’m using zshrc on this box at the time)
ie:
and then do this:
@vic Yeah, I can try and find some time to work on this.
@jthegedus I kinda screwed up by responding all over the place, so I wrote a response https://github.com/asdf-vm/asdf/issues/891#issuecomment-799400852 and will be following up there if that’s ok.
To follow up, the reason this fails, as @deiga said here is based on how Homebrew is linking the files when doing a
prefix.install
https://github.com/asdf-vm/asdf/issues/607#issuecomment-560447230That’s the problem since you’re scattering scripts that depend on relative paths to source each other. If anyone is interested, I’ve added a fix to the formula https://github.com/Homebrew/homebrew-core/pull/73173 that puts everything in a single folder without linking them, and makes a symlink to the binary under
/usr/local/bin/asdf
. Now this means thatASDF_DATA_DIR
andASDF_USER_SHIMS
aren’t set and shims aren’t under your$PATH
That’s two things.For the first matter,
asdf
should (and seem) to be coded with such manner that$HOME/.asdf
is the default values for anywhere it expects$ASDF_DATA_DIR
- though it mixes between checking a variable and using a function for that look up.For the second matter, users just have to add
export PATH="${$HOME/.asdf/shim}:$PATH"
This is better, as you’re simply just adding binaries to your path just like any other, instead of loading some script.
Obviously you can still load your script as the documentation currently states, just have to change the path .
On v0.7.8, this issue still appears
re-pro steps are here
It seems to work with the latest version of asdf (v0.7.7 at the time of writing):
@vic That weirdness comes from the fact, that the Homebrew formula links all directories in the
asdf
repo and this line https://github.com/asdf-vm/asdf/blob/master/bin/asdf#L4In the meantime you could use the
bin/asdf
from the real location where asdf was installed by homebrew.