freewebwithme

freewebwithme

Failed to run 'elixir' command error in vs code

Using vs code and installed ElixirLS: support and debugger.
And I got an error popped up on start up says

Failed to run ‘elixir’ command. ElixirLS will probably fail to launch. Logged PATH to Development Console.

I think elixir command is in current path

which elixir
/home/user/.asdf/shims/elixir

and

echo $PATH
...........:/home/user/.asdf/shims:.....................
What is my problem?

Marked As Solved

NobbZ

NobbZ

You probably add asdf only to the PATH in your shells RC file.

To make it available to your GUI as well you neet to add it to your .Xprofile or whatever is read by your GUI.

Also Liked

jmnda

jmnda

Setting erlang and elixir globally solve the issue for me as well
asdf global erlang <your_version>
asdf global elixir <your_version>

wdiechmann

wdiechmann

@Facundo I can confirm that! Just <upgraded> my MacBook Air M1 to BigSur - and the next thing I noticed was that ElixirLS fails to start in VSCode

my .zshrc is good as is my asdf local elixir 1.12.0

I may have installed asdf with brew first - but my current installation is tucked away safely in $HOME/.asdf :sunglasses:

Tried iex from CLI only to learn that elixir wasn’t the issue at all - erl was! (Note: I run all my workbench stuff in containers which is probably why I haven’t noticed)

Once I got my asdf global erlang 24.1 out of the way - all was good in VSCode on macOS BigSur land :smile:

NobbZ

NobbZ

How do you start VScode?

It might have a different view to your PATH than your shell, especially if you start it from a graphical environment rather from the terminal.

Please check the PATH logged into the console as explained by the error.

Please also check if the error persists when starting VScode from within a terminal that already is in the projects folder if you do not already open it that way. Depending on your operating system/flavor of it, you might need to run one of vscode . or code ..

NobbZ

NobbZ

Try a local user install as described by asdf rather than some package manager that installs system wide.

Facundo

Facundo

Click on View → Terminal
Select output tab
Then select ElixirLS from the dropdown

Where Next?

Popular in Questions Top

JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
Fl4m3Ph03n1x
Background Let’s assume I have a typical GenServer that receives messages as requests, does some operation in a DB and returns responses....
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
sabri
Can someone explain the settings of pool_size of Ecto in config file? and what is the recommend size? Thanks
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

Other popular topics Top

sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
magnetic
Hey :wave:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New

We're in Beta

About us Mission Statement