sublimelsp / LSP-elixir

Elixir support for Sublime LSP plugin

Home Page:https://lsp.sublimetext.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error "LSP-elixir exited with status code 127" on start

yeraydiazdiaz opened this issue · comments

Hi all, thank you for your work on LSP-elixir.

When installing the package and enabling it in my Elixir project I get an error immediately:

Screenshot 2021-09-19 at 10 02 39

The Sublime Text console only shows LSP: starting ['/Users/yeray/Library/Caches/Sublime Text 3/Package Storage/LSP-elixir/server/0.8.1/language_server.sh'] in /Users/yeray/code/personal/shoutouts.dev

Running the language_server.sh in my terminal seems to work fine, I can see some output from the language server, like:

Content-Length: 102

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Started ElixirLS v0.8.1","type":4}}

I found a similar issue erlang-ls/erlang_ls#783 but I'm not sure how it translates to elixir-ls, I tried running import shutil; shutil.which("elixir_ls") in the console but got no output.

Any ideas? Thanks!

Hi, although your path shows st3, could you confirm if you are on st3 or st4?

Does restarting the editor do anything?

I'm on ST4, and unfortunately restarting doesn't help.

Looking a bit deeper I believe it might be a PATH issue and the script is not finding Elixir.

ah. yeah this might very well be the issue.

the package installs elixir-ls for you, so that shouldn't be the issue.

the elixir executable is the other important part of the equation.

It was the PATH env var. Turns out I'm using a Mac OS X launcher app to start ST4 that for some reason does not respect the .zshrc exports so ST4 can't find most executables.

Thanks for the replies 👍🏻

I have upgraded Erlang from OTP 24 to OTP 25 with asdf, and I am having the same issue.

@rwols' link solved my problem. so in ~/.zprofile i appended (in my case im using asdf):

export PATH="/path/to/.asdf/shims:/usr/local/bin:$PATH"