{"record":{"id":"f64972ff281c2eca","repo":"oraios/serena","slug":"r-is-not-installed-please-install-r-from-https","errorCode":null,"errorMessage":"R is not installed. Please install R from https://www.r-project.org/","messagePattern":"R is not installed\\. Please install R from https://www\\.r-project\\.org/","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/r_language_server.py","lineNumber":55,"sourceCode":"            result = subprocess_run([\"R\", \"--version\"], capture_output=True, text=True, check=False)\n            if result.returncode != 0:\n                raise RuntimeError(\"R is not installed or not in PATH\")\n\n            # Check languageserver package\n            result = subprocess_run(\n                [\"R\", \"--vanilla\", \"--quiet\", \"--slave\", \"-e\", \"if (!require('languageserver', quietly=TRUE)) quit(status=1)\"],\n                capture_output=True,\n                text=True,\n                check=False,\n            )\n\n            if result.returncode != 0:\n                raise RuntimeError(\n                    \"R languageserver package is not installed.\\nInstall it with: R -e \\\"install.packages('languageserver')\\\"\"\n                )\n\n        except FileNotFoundError:\n            raise RuntimeError(\"R is not installed. Please install R from https://www.r-project.org/\")\n\n    def __init__(self, config: LanguageServerConfig, repository_root_path: str, solidlsp_settings: SolidLSPSettings):\n        # Check R installation\n        self._check_r_installation()\n\n        # R command to start language server\n        # Use --vanilla for minimal startup and --quiet to suppress all output except LSP\n        # Set specific options to improve parsing stability\n        r_cmd = 'R --vanilla --quiet --slave -e \"options(languageserver.debug_mode = FALSE); languageserver::run()\"'\n\n        super().__init__(config, repository_root_path, ProcessLaunchInfo(cmd=r_cmd, cwd=repository_root_path), \"r\", solidlsp_settings)\n\n    def _create_base_initialize_params(self) -> dict:\n        \"\"\"Initialize params for R Language Server.\"\"\"\n        initialize_params = {\n            \"locale\": \"en\",\n            \"capabilities\": {\n                \"textDocument\": {","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/r_language_server.py#L37-L73","documentation":"The whole probe in `_check_r_installation()` is wrapped in `except FileNotFoundError`, which fires when the `R` executable itself cannot be spawned at all (the OS returns ENOENT, not a non-zero exit). The wrapper converts that into this RuntimeError pointing at the official R download page.","triggerScenarios":"Instantiating the R language server on a machine where no `R` binary exists on PATH at all — R never installed, or the process environment's PATH lacks the directory containing `R`.","commonSituations":"Docker images or CI runners without R installed; macOS without Homebrew R and no command-line R; IDE/daemon launched with a sanitized PATH that omits /usr/local/bin or Homebrew paths; Windows install that didn't add R to PATH.","solutions":["Install R: `apt install r-base` / `brew install r` / download from https://www.r-project.org/","Add R's bin directory to PATH (e.g. `export PATH=\"$PATH:/usr/local/bin\"` or the Rtools/R install dir on Windows) in the environment that launches the app","Confirm with `command -v R && R --version` in the exact shell/container running the library before starting it"],"exampleFix":"# before (Dockerfile)\nFROM python:3.11-slim\nRUN pip install multilspy  # no R present\n\n# after\nFROM python:3.11-slim\nRUN apt-get update && apt-get install -y r-base && R -e \"install.packages('languageserver')\"\nRUN pip install multilspy","handlingStrategy":"validation","validationCode":"import shutil\nif shutil.which(\"R\") is None:\n    raise SystemExit(\"R not found on PATH; install from https://www.r-project.org/ and add its bin dir to PATH\")","typeGuard":"def r_on_path() -> bool:\n    return shutil.which(\"R\") is not None","tryCatchPattern":"try:\n    server = RLanguageServer(config, repo_root, settings)\nexcept RuntimeError as e:\n    if \"www.r-project.org\" in str(e):\n        logger.error(\"R executable missing: %s\", e)\n        raise SystemExit(1) from e\n    raise","preventionTips":["Install r-base in the base image/CI runner used by the project","Check `command -v R` in setup scripts before running the app","Watch for sanitized PATHs in daemons/IDE-spawned processes; set PATH explicitly in the service environment"],"tags":["r","missing-binary","path","environment"],"backgroundTag":"command-not-found","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}