{"record":{"id":"1e692afb7d0a2b79","repo":"jdx/mise","slug":"brew-is-not-available-1e692a","errorCode":null,"errorMessage":"brew is not available: {}","messagePattern":"brew is not available: (.+?)","errorType":"exception","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/cli/system/prune.rs","lineNumber":61,"sourceCode":"        {\n            bail!(\n                \"manager '{}' is excluded by the system_packages.managers setting\",\n                self.manager\n            );\n        }\n        match self.manager.as_str() {\n            \"brew\" => self.run_brew().await,\n            \"brew-cask\" => self.run_brew_cask().await,\n            _ => unreachable!(),\n        }\n    }\n\n    #[cfg(unix)]\n    async fn run_brew(self) -> Result<()> {\n        debug_assert_eq!(self.manager, \"brew\");\n        let manager = brew::BrewManager::new();\n        if !manager.is_available() {\n            bail!(\"brew is not available: {}\", manager.unavailable_reason());\n        }\n        let config = Config::get().await?;\n        let configured = system::packages_from_config_and_tracked_config_files(&config)\n            .await?\n            .into_iter()\n            .find(|mp| mp.manager.name() == \"brew\")\n            .map(|mp| mp.requests)\n            .unwrap_or_default();\n        let plan = brew::prune_plan(&configured).await?;\n        if plan.is_empty() {\n            info!(\"brew: nothing to prune\");\n            return Ok(());\n        }\n        if self.dry_run {\n            brew::apply_prune_plan(&plan, true)?;\n            return Ok(());\n        }\n        let remove = plan","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/cli/system/prune.rs#L43-L79","documentation":"`mise bootstrap packages prune --manager brew` needs the Homebrew CLI. `brew::BrewManager::is_available()` (which locates the `brew` executable) returned false, so run_brew bails with the reason from `unavailable_reason()` — typically that `brew` is not installed or not found on PATH.","triggerScenarios":"Pruning with `--manager brew` on a host without Homebrew installed, or where the brew binary directory (e.g. /home/linuxbrew/.linuxbrew/bin or /opt/homebrew/bin) is missing from the PATH that mise inherits.","commonSituations":"Fresh CI container without brew; running mise from a non-login shell or GUI-launched process whose PATH omits the brew prefix; Linux machine where only linuxbrew would provide brew and it was never installed.","solutions":["Confirm with `command -v brew` in the same shell mise runs from — if empty, install Homebrew (macOS: /bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\")","If brew is installed but not found, add its bin dir to PATH (eval \"$(brew shellenv)\") in the shell profile or set MISE_ENV_PATH/PATH accordingly","On Linux, install Linuxbrew or prune with a manager that exists on the host"],"exampleFix":"# before\n$ mise bootstrap packages prune --manager brew\n# error: brew is not available: ...\n\n# after\n$ /bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"\n$ eval \"$(brew shellenv)\"\n$ mise bootstrap packages prune --manager brew","handlingStrategy":"validation","validationCode":"if ! command -v brew >/dev/null 2>&1; then\n  echo \"skip: brew not installed\" >&2\n  exit 0\nfi\nmise bootstrap packages prune --manager brew","typeGuard":null,"tryCatchPattern":"mise bootstrap packages prune --manager brew || { echo \"brew unavailable — install Homebrew or fix PATH (eval \\\"$(brew shellenv)\\\")\" >&2; exit 1; }","preventionTips":["Bootstrap scripts should install Homebrew (or eval brew shellenv) before mise package commands","In CI, cache the brew prefix and add it to PATH explicitly at job start","Gate brew-based steps on `command -v brew` so non-brew hosts skip cleanly"],"tags":["mise","brew","homebrew","prune","path","system-packages"],"backgroundTag":"required-tool-not-on-path","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}