{"record":{"id":"b217e7f23bf181b6","repo":"jdx/mise","slug":"brew-is-not-available","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/import.rs","lineNumber":91,"sourceCode":"            .system_packages\n            .managers\n            .as_ref()\n            .is_some_and(|enabled| !enabled.contains(&self.manager))\n        {\n            bail!(\n                \"manager '{}' is excluded by the system_packages.managers setting\",\n                self.manager\n            );\n        }\n        self.run_brew().await\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 formulae = brew::linked_formulae(self.all)?;\n        if formulae.is_empty() {\n            info!(\"brew: no installed formulae to import\");\n            return Ok(());\n        }\n\n        let path = resolve_target_config_path(ConfigPathOptions {\n            global: self.global,\n            path: self.path.clone(),\n            env: self.env.clone(),\n            cwd: None,\n            prefer_toml: true,\n            prevent_home_local: true,\n        })?;\n\n        let configured_taps = configured_brew_taps(&path).await?;\n        let config = Config::get().await?;","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/cli/system/import.rs#L73-L109","documentation":"The brew import path first constructs a BrewManager and checks availability; if Homebrew is not usable on this Unix machine (missing binary, broken install), the import aborts with the manager's own unavailability reason. This is the Unix-side counterpart of the availability guard: importing requires brew to actually be queryable for linked formulae.","triggerScenarios":"Running `mise system import brew` on a Unix system where `brew` is not installed or not on PATH (manager.is_available() returns false, and unavailable_reason() supplies the detail).","commonSituations":"Fresh Linux box or container without Homebrew; CI images without brew; brew installed to a non-standard prefix/PATH not visible in non-interactive shells; broken brew install.","solutions":["Install Homebrew (/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\") and ensure it is on PATH, then retry","If brew is installed but not found, fix PATH in the shell/CI where mise runs (e.g. /home/linuxbrew/.linuxbrew/bin or /opt/homebrew/bin)","If you did not mean to import from brew, check the manager argument you passed to `mise system import`"],"exampleFix":"# before\nmise system import brew   # fails: brew not available\n\n# after\neval \"$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)\"   # or install brew\nmise system import brew","handlingStrategy":"validation","validationCode":"# bash: require a working brew before import\ncommand -v brew >/dev/null 2>&1 && brew --version >/dev/null 2>&1 || { echo \"brew unavailable\" >&2; exit 2; }\nmise system import brew","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install Homebrew in the image/machine before running imports; add its bin dir to PATH for non-interactive shells","Skip gracefully in scripts: `command -v brew >/dev/null || exit 0`"],"tags":["system-packages","import","brew","availability"],"backgroundTag":"package-manager-unavailable","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}