oraios/serena · error · RuntimeError

Elixir is not installed. Please install Elixir from https://

Error message

Elixir is not installed. Please install Elixir from https://elixir-lang.org/install.html and make sure it is added to your PATH.

What it means

ElixirTool's runtime setup requires the Elixir toolchain (elixir executable) on PATH before it can build/install its 'expert' language server dependency. When elixir cannot be found or executed, _setup_runtime_dependencies raises RuntimeError telling you to install Elixir and add it to PATH.

Source

Thrown at src/solidlsp/language_servers/elixir_tools/elixir_tools.py:85

            result = subprocess_run(["elixir", "--version"], capture_output=True, text=True, check=False)
            if result.returncode == 0:
                return result.stdout.strip()
        except FileNotFoundError:
            return None
        return None

    @classmethod
    def _setup_runtime_dependencies(cls, config: LanguageServerConfig, solidlsp_settings: SolidLSPSettings) -> str:
        """
        Setup runtime dependencies for Expert.
        Downloads the Expert binary for the current platform and returns the path to the executable.
        """
        elixir_settings = solidlsp_settings.get_ls_specific_settings(LanguageServerId.ELIXIR)
        expert_version = elixir_settings.get("expert_version", EXPERT_VERSION)
        # Check if Elixir is available first
        elixir_version = cls._get_elixir_version()
        if not elixir_version:
            raise RuntimeError(
                "Elixir is not installed. Please install Elixir from https://elixir-lang.org/install.html and make sure it is added to your PATH."
            )

        log.info(f"Found Elixir: {elixir_version}")

        # First, check if expert is already in PATH (user may have installed it manually)
        import shutil

        expert_in_path = shutil.which("expert")
        if expert_in_path:
            log.info(f"Found Expert in PATH: {expert_in_path}")
            return expert_in_path

        platform_id = PlatformUtils.get_platform_id()

        valid_platforms = [
            PlatformId.LINUX_x64,
            PlatformId.LINUX_arm64,

View on GitHub (pinned to 7fcbca7e62)

Solutions

  1. Install Elixir from https://elixir-lang.org/install.html (e.g., apt install elixir, brew install elixir, or asdf/mise)
  2. Verify with: elixir --version (must run in the same environment that launches Serena)
  3. Ensure the Elixir bin directory is on PATH for the process running Serena (export PATH=...), including IDE-launched sessions
  4. If using asdf/mise, run the shim setup so non-interactive shells resolve elixir

Example fix

// before (PATH without elixir)
$ which elixir   # nothing
// after
$ export PATH="$HOME/.asdf/shims:$PATH"
$ elixir --version
Elixir 1.16.2
Defensive patterns

Strategy: validation

Validate before calling

import shutil, subprocess
def elixir_available() -> bool:
    return shutil.which("elixir") is not None and subprocess.run(
        ["elixir", "--version"], capture_output=True
    ).returncode == 0

Type guard

def has_elixir() -> bool:
    import shutil
    return shutil.which("elixir") is not None

Try / catch

try:
    server = LanguageServer.create(LanguageServerId.ELIXIR, ...)
except RuntimeError as e:
    if "Elixir is not installed" in str(e):
        install_elixir_and_extend_path()  # then retry

Prevention

When it happens

Trigger: Instantiating the Elixir language server (via __init__ during LanguageServer.create) on a machine where the `elixir` command is absent from PATH or fails to report a version.

Common situations: Fresh machines/containers with only Erlang installed; Elixir installed via asdf/mise but the shim not activated in the shell Serena runs in; PATH differing between interactive shell and the process launching Serena.

Related errors


AI-assisted analysis of oraios/serena@7fcbca7e62 (2026-08-29). Data as JSON: /api/errors/63aee9ad7073d0ce. Report an issue: GitHub.