From 14e6635383fe11a16387b440d52666576301f486 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Mon, 17 Feb 2025 10:31:58 -0600 Subject: [PATCH] Add Fix Shim Path After asdf Upgrade as a Unix TIL --- README.md | 3 ++- unix/fix-shim-path-after-asdf-upgrade.md | 34 ++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 unix/fix-shim-path-after-asdf-upgrade.md diff --git a/README.md b/README.md index c1bbab4..1eb1d16 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ pairing with smart people at Hashrocket. For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186). -_1591 TILs and counting..._ +_1592 TILs and counting..._ See some of the other learning resources I work on: - [Ruby Operator Lookup](https://www.visualmode.dev/ruby-operators) @@ -1531,6 +1531,7 @@ See some of the other learning resources I work on: - [Find Newer Files](unix/find-newer-files.md) - [Find Occurrences Of Multiple Values With Ripgrep](unix/find-occurrences-of-multiple-values-with-ripgrep.md) - [Find Top-Level Directories Matching A Pattern](unix/find-top-level-directories-matching-a-pattern.md) +- [Fix Shim Path After asdf Upgrade](unix/fix-shim-path-after-asdf-upgrade.md) - [Fix Unlinked Node Binaries With asdf](unix/fix-unlinked-node-binaries-with-asdf.md) - [Forward Multiple Ports Over SSH](unix/forward-multiple-ports-over-ssh.md) - [Generate A SAML Key And Certificate Pair](unix/generate-a-saml-key-and-certificate-pair.md) diff --git a/unix/fix-shim-path-after-asdf-upgrade.md b/unix/fix-shim-path-after-asdf-upgrade.md new file mode 100644 index 0000000..c7a2f7d --- /dev/null +++ b/unix/fix-shim-path-after-asdf-upgrade.md @@ -0,0 +1,34 @@ +# Fix Shim Path After asdf Upgrade + +While doing [`brew install groff`](aws/aws-cli-requires-groff-executable.md), +Homebrew decided to upgrade every last thing it knows about on my machine, +including `asdf`. + +`asdf` has undergone some big recent changes, including [a rewrite in +Go](https://stratus3d.com/blog/2025/02/03/asdf-has-been-rewritten-in-go/). + +I noticed that `asdf` wasn't picking up my specified tool versions. I tried an +`asdf reshim`, but that didn't do the trick. Someone else wrote that [asdf +seems broken after homebrew +upgrade](https://braytonium.com/2023/01/09/asdf-seems-broken-after-homebrew-upgrade/) +which gave some hints and pointed me to some interesting GitHub issues. + +Additionally, I noticed when opening a fresh terminal session the following error from `zsh`: + +```bash +/Users/jbranchaud/.zshrc:.:225: no such file or directory: /usr/local/opt/asdf/libexec/asdf.sh +``` + +That directory and file is gone. So, how does `asdf` now want you to configure +its path with `zsh`? Revisiting their updated docs, I can see that the instead +of sourcing that shell script, we should now export shims to the path: + +```bash +# . /usr/local/opt/asdf/libexec/asdf.sh +export PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH" +``` + +Updating my `.zshrc` to the above and then reloading did the trick. My tool +versions are registering now. + +[source](https://asdf-vm.com/guide/getting-started.html#_2-configure-asdf)