jdx/mise · error · eyre::Report

brew-cask is not available: {}

Error message

brew-cask is not available: {}

What it means

`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).

Source

Thrown at src/cli/system/prune.rs:102

        if !self.yes && !Settings::get().yes && console::user_attended_stderr() {
            let msg = format!("brew: prune {}?", remove.join(", "));
            if !prompt::confirm(msg)? {
                info!("brew: skipped");
                return Ok(());
            }
        }
        let removed = plan.remove.len();
        brew::apply_prune_plan(&plan, false)?;
        info!("brew: pruned {removed} formulae");
        Ok(())
    }

    #[cfg(unix)]
    async fn run_brew_cask(self) -> Result<()> {
        debug_assert_eq!(self.manager, "brew-cask");
        let manager = brew::BrewCaskManager::new();
        if !manager.is_available() {
            bail!(
                "brew-cask is not available: {}",
                manager.unavailable_reason()
            );
        }
        let config = Config::get().await?;
        let configured = system::packages_from_config_and_tracked_config_files(&config)
            .await?
            .into_iter()
            .find(|mp| mp.manager.name() == "brew-cask")
            .map(|mp| mp.requests)
            .unwrap_or_default();
        let plan = brew::cask_prune_plan(&configured).await?;
        for skipped in &plan.skipped {
            warn!("brew-cask:{}: skipped: {}", skipped.token, skipped.reason);
        }
        if plan.is_empty() {
            info!("brew-cask: nothing to prune");
            return Ok(());

View on GitHub (pinned to 9dcfcaa0dc)

Solutions

  1. Check `brew --version` works in the same environment mise runs in; install/repair Homebrew if not
  2. 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)
  3. Ensure PATH includes the brew bin directory (eval "$(brew shellenv)")

Example fix

# before
$ mise bootstrap packages prune --manager brew-cask   # on Linux
# error: brew-cask is not available: ...

# after
# move cask entries into a macOS-only config
$ git mv mise.toml mise.macos.toml 2>/dev/null; mise settings add config.macos mise.macos.toml || true
Defensive patterns

Strategy: validation

Validate before calling

# casks require brew and macOS
case "$(uname)" in
  Darwin) command -v brew >/dev/null 2>&1 || { echo 'skip: brew missing'; exit 0; } ;;
  *) echo 'skip: brew-cask is macOS-only'; exit 0 ;;
esac
mise bootstrap packages prune --manager brew-cask

Try / catch

mise bootstrap packages prune --manager brew-cask || { echo "brew-cask unavailable: need macOS + Homebrew" >&2; exit 1; }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of jdx/mise@9dcfcaa0dc (2026-08-17). Data as JSON: /api/errors/e49295746d39503c. Report an issue: GitHub.