-
Notifications
You must be signed in to change notification settings - Fork 180
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
Error on asdf >= 0.16.0: "Automatic Ruby environment activation with asdf failed: Could not find ASDF installation" #3143
Comments
Thank you for the workaround 🙌🏻 |
Details of the rewrite: https://github.com/asdf-vm/asdf/blob/master/CHANGELOG.md#0160-2025-01-30 |
Thank you for the report. Since we still need to support old versions while people are migrating, I believe we can implement finding the It would essentially mean:
Where is the new ASDF executable installed? We're going to need to search for it for Homebrew installations, but also take Linux into account. |
It could be installed anywhere in the
I think a better approach here is to just detect if the command exists or not, and only fall back to loading the script if it doesn't. |
It's not enough to just search the Preferably, we should have a list of common paths we search first, as we do for the other version managers. Typically, that's Homebrew paths for Mac and the usual We also already let users configure the path to the ASDF executable, which offers an escape hatch, but we should still automatically search the most common places. The current possible paths we search is here (for the script version of ASDF). If people could please confirm the paths to the
|
On homebrew M series I'm getting |
I have the same path as @zarembas for homebrew M series. Just to confirm, OP's workaround does work for me but the following does not:
|
To add some info to the last comment, when setting
|
But that is a binary, not a shell script (as ruby-lsp seems to expect). Which is why this does not work:
But this does:
|
The changes in #3185 should add proper support for v0.16. |
TL;DR and workaround
The new golang rewrite of the
asdf
package manager no longer has an initialization shell script, which breaks the Ruby LSP extension as it does not handle the case ofasdf
already being in thePATH
as an executable binary.This can be fixed for the time being by just making an empty executable shell script in place of it with this one-liner:
So far everything has been working as usual for me after doing this.
Ruby LSP Information
VS Code Version
1.96.4
Ruby LSP Extension Version
0.8.20
Ruby LSP Server Version
0.23.8
Ruby LSP Add-ons
Ruby Version
3.3.7
Ruby Version Manager
asdf
Installed Extensions
Click to expand
Ruby LSP Settings
Click to expand
Workspace
User
Reproduction steps
asdf
>= 0.16.0
asdf
location resolutionCode snippet or error message
The text was updated successfully, but these errors were encountered: