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 ..

Where Next?

Popular in Questions Top

hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a &gt; b) do {:ok, "a"} end if (a &lt; b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
Kurisu
For example for a current url like http://localhost:4000/cosmetic/products?_utf8=✓&amp;query=perfume&amp;page=2, I would like to get: ...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: The documentation above suggests that while ...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
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
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New

Other popular topics Top

axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 48475 226
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a &gt; b) do {:ok, "a"} end if (a &lt; b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
jaysoifer
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)? Would mix ecto.rollback -v 200809061...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

We're in Beta

About us Mission Statement