{"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":null,"httpStatus":null,"severity":"error","filePath":"src/cli/system/prune.rs","lineNumber":180,"sourceCode":"        if !self.yes && !Settings::get().yes && console::user_attended_stderr() {\n            let msg = format!(\"brew: prune {}?\", remove.join(\", \"));\n            if !prompt::confirm(msg)?.is_yes() {\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":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/system/prune.rs#L162-L198","documentation":"mise's `mise system prune brew-cask` requires the Homebrew cask manager. Before pruning, it constructs a BrewCaskManager and checks `is_available()`; if Homebrew (or its cask support) cannot be located or initialized, the unavailable reason is surfaced via this bail to stop the prune before any packages are touched.","triggerScenarios":"Running `mise system prune brew-cask` (or the equivalent manager selection routed to run_brew_cask) on a machine where the `brew` binary is not installed, not on PATH, or the Homebrew prefix cannot be resolved — `BrewCaskManager::new().is_available()` returns false and `unavailable_reason()` supplies the detail interpolated into the message.","commonSituations":"Running brew-cask prune on Linux without Homebrew installed; Homebrew installed in a non-default prefix not discovered by mise; PATH stripped of brew in CI or non-interactive shells; invoking the command on a machine where only formulae (no casks) are managed.","solutions":["Install Homebrew so `brew` is on PATH, then re-run the prune command","Verify discovery with `brew --version` in the same shell where mise runs; fix PATH or HOMEBREW_PREFIX if it fails","Use `mise system prune brew` (formulae) instead if you only need formula pruning and casks are irrelevant","Run the command on macOS/Homebrew-supported platforms, since cask management is Homebrew-dependent"],"exampleFix":"// before (brew missing)\nmise system prune brew-cask\n# error: brew-cask is not available: ...\n// after\nbrew --version || /bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"\nmise system prune brew-cask","handlingStrategy":"fallback","validationCode":"command -v brew >/dev/null 2>&1 && mise system prune brew-cask || echo 'homebrew unavailable'","typeGuard":null,"tryCatchPattern":"if ! mise system prune brew-cask; then echo 'skipping cask prune: homebrew unavailable'; fi","preventionTips":["Check `brew --version` availability before running brew-based mise commands in scripts","Pin CI brew-prune steps to macOS runners","Keep Homebrew on PATH in non-interactive shells (profile/rc files)"],"tags":["homebrew","prune","cli","dependency-missing"],"backgroundTag":"missing-dependency","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}