-
Notifications
You must be signed in to change notification settings - Fork 779
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
bug: The terminal in VS Code cannot find the ruby version installed by asdf #1584
Comments
Does opening and closing VSCode or logging in and out fix the issue? I suspect this is an issue with your terminal session not receiving the updated environment variables. It might also be worth looking into the |
Trying to debug using steps in asdf-vm/asdf-ruby#103 Notice the order in which ruby is listed in terminal, and then inside terminal in vscode. I'm not sure (yet) what and where determines loading orders, but it might have something to do with it. |
A bit more debuggin info: if I use fish, bash or zsh in Terminal VS Code session - I have this problem, but if I load pwsh ( PowerShell for OSX) , then asdf / ruby is recodnized. |
So it definitely has something to do with the load order. I unset and then set $PATH in my integrated terminal ( just making sure asdf shims are loaded first) , and it works . SO just need to figure out where the $PATH is getting changed by VSCODE, and why |
So the solution for me finally was to make sure that asdf is loaded before anything else in my At the very top - BEFORE ANYTHING ELSE
Still not sure what the root cause of it ( will need to investigate later) - my fish config is fairly big, with many customizations. Just wanted to report back a solution. |
Seeing the same issue. Interestingly, when ruby
But
When comparing $PATH on both integrated and external terminals, the value are different I don't think it's an asdf issue but rather something to do with vscode handling of the PATH |
this did the trick for me |
Describe the Bug
The ruby version in Iterm2 is correct
Steps to Reproduce
ruby -v
Expected Behaviour
The terminal in VS Code can use the ruby installed by asdf normally.
Actual Behaviour
The terminal in VS Code uses the ruby version that comes with mac.
Environment
OS: Darwin aiyuhangdeMacBook-Pro.local 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:22 PDT 2023; root:xnu-8796.121.3~7/RELEASE_X86_64 x86_64 SHELL: zsh 5.9 (x86_64-apple-darwin22.0) BASH VERSION: 3.2.57(1)-release ASDF VERSION: v0.11.3-2f55f93 ASDF INTERNAL VARIABLES: ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions ASDF_DATA_DIR=/Users/aiyuhang/.asdf ASDF_DIR=/Users/aiyuhang/.asdf ASDF_CONFIG_FILE=/Users/aiyuhang/.asdfrc ASDF INSTALLED PLUGINS: nodejs https://github.com/asdf-vm/asdf-nodejs.git master 4f8aa3d ruby https://github.com/asdf-vm/asdf-ruby.git master bc6e7c3
asdf plugins affected (if relevant)
No response
The text was updated successfully, but these errors were encountered: