{"record":{"id":"e49295746d39503c","repo":"jdx/mise","slug":"brew-cask-is-not-available","errorCode":null,"errorMessage":"brew-cask is not available: {}","messagePattern":"brew-cask is not available: (.+?)","errorType":"exception","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/cli/system/prune.rs","lineNumber":102,"sourceCode":"        if !self.yes && !Settings::get().yes && console::user_attended_stderr() {\n            let msg = format!(\"brew: prune {}?\", remove.join(\", \"));\n            if !prompt::confirm(msg)? {\n                info!(\"brew: skipped\");\n                return Ok(());\n            }\n        }\n        let removed = plan.remove.len();\n        brew::apply_prune_plan(&plan, false)?;\n        info!(\"brew: pruned {removed} formulae\");\n        Ok(())\n    }\n\n    #[cfg(unix)]\n    async fn run_brew_cask(self) -> Result<()> {\n        debug_assert_eq!(self.manager, \"brew-cask\");\n        let manager = brew::BrewCaskManager::new();\n        if !manager.is_available() {\n            bail!(\n                \"brew-cask is not available: {}\",\n                manager.unavailable_reason()\n            );\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-cask\")\n            .map(|mp| mp.requests)\n            .unwrap_or_default();\n        let plan = brew::cask_prune_plan(&configured).await?;\n        for skipped in &plan.skipped {\n            warn!(\"brew-cask:{}: skipped: {}\", skipped.token, skipped.reason);\n        }\n        if plan.is_empty() {\n            info!(\"brew-cask: nothing to prune\");\n            return Ok(());","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/cli/system/prune.rs#L84-L120","documentation":"`mise bootstrap packages prune --manager brew-cask` requires a working Homebrew with cask support. `brew::BrewCaskManager::is_available()` returned false, so run_brew_cask bails with `unavailable_reason()` — brew missing entirely, or cask functionality unavailable on this host (casks are macOS-only).","triggerScenarios":"Pruning with `--manager brew-cask` when brew is not installed/not on PATH, or on a Linux host where brew exists but has no cask capability.","commonSituations":"Linux machine reusing a shared mise.toml that tracks brew-cask packages; CI image with plain Homebrew but no cask support; PATH not containing the brew prefix in non-interactive shells.","solutions":["Check `brew --version` works in the same environment mise runs in; install/repair Homebrew if not","On Linux, drop brew-cask from the workflow — casks are macOS-only; scope the config with [env] or per-platform config files (e.g. mise.macos.toml vs mise.linux.toml)","Ensure PATH includes the brew bin directory (eval \"$(brew shellenv)\")"],"exampleFix":"# before\n$ mise bootstrap packages prune --manager brew-cask   # on Linux\n# error: brew-cask is not available: ...\n\n# after\n# move cask entries into a macOS-only config\n$ git mv mise.toml mise.macos.toml 2>/dev/null; mise settings add config.macos mise.macos.toml || true","handlingStrategy":"validation","validationCode":"# casks require brew and macOS\ncase \"$(uname)\" in\n  Darwin) command -v brew >/dev/null 2>&1 || { echo 'skip: brew missing'; exit 0; } ;;\n  *) echo 'skip: brew-cask is macOS-only'; exit 0 ;;\nesac\nmise bootstrap packages prune --manager brew-cask","typeGuard":null,"tryCatchPattern":"mise bootstrap packages prune --manager brew-cask || { echo \"brew-cask unavailable: need macOS + Homebrew\" >&2; exit 1; }","preventionTips":["Scope cask package entries to macOS-only config layers so Linux runs never attempt them","Check `uname` and `command -v brew` before cask operations in shared scripts"],"tags":["mise","brew-cask","homebrew","prune","macos","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"}