jdx/mise · error
failed to provision ruby for building from source (try `mise
Error message
failed to provision ruby for building from source (try `mise install ruby`)
What it means
Building a formula from source requires executing the Ruby formula file, so mise scans the current toolset for a ruby binary it installed. If no mise-managed ruby is present, provisioning fails and the build stops with an actionable hint. System rubies installed outside mise are not considered.
Source
Thrown at src/system/packages/brew/source.rs:211
// only ruby — never drag the rest of the config's toolset in
missing_args_only: true,
reason: "brew source build".to_string(),
..Default::default()
},
)
.await?;
for (backend, tv) in ts.list_current_versions() {
if tv.ba().short != "ruby" {
continue;
}
for bin_dir in backend.list_bin_paths(&config, &tv).await? {
let ruby = bin_dir.join("ruby");
if ruby.is_file() {
return Ok(ruby);
}
}
}
bail!("failed to provision ruby for building from source (try `mise install ruby`)");
}
/// Download the formula's .rb from homebrew/core, pinned to the commit the
/// API metadata was generated from and verified against its sha256.
async fn fetch_formula_rb(rf: &ResolvedFormula, pr: &dyn SingleReport) -> Result<PathBuf> {
let formula = &rf.formula;
// all guaranteed present by check_buildable
let rb_path = formula.ruby_source_path.as_ref().unwrap();
let sha256 = formula
.ruby_source_checksum
.as_ref()
.and_then(|c| c.sha256.as_deref())
.unwrap();
let commit = formula.tap_git_head.as_deref().unwrap();
let cache_dir = crate::dirs::CACHE.join("system-brew").join("formula");
let dest = cache_dir.join(format!("{}-{}.rb", formula.name, &sha256[..12]));
if dest.exists() && crate::hash::ensure_checksum(&dest, sha256, None, "sha256").is_ok() {
return Ok(dest);View on GitHub (pinned to 9dcfcaa0dc)
Solutions
- Run `mise install ruby` (or add ruby to mise.toml tools), then retry the package install
- Add ruby to your bootstrap config so it is always present before any source build
- Avoid the source-build path entirely by ensuring a bottle exists for your platform
Example fix
# before $ mise bootstrap packages apply # -> failed to provision ruby for building from source # after $ mise install ruby $ mise bootstrap packages apply
Defensive patterns
Strategy: validation
Validate before calling
# ensure a mise-managed ruby exists before any source build mise ls current ruby 2>/dev/null | grep -q . || mise install ruby
Prevention
- Add ruby to your mise tools/bootstrap config on machines that may build formulae from source
- Remember mise only finds ruby it installed itself — system rubies are not used
- Bottle-less platforms hit the source path most; pre-install ruby there
When it happens
Trigger: provision_ruby iterates ts.list_current_versions(), finds no ruby backend/version, and no toolset bin path contains a `ruby` binary — i.e. a source build was attempted without `mise install ruby`.
Common situations: Fresh machines or minimal containers where ruby was never added to the mise toolset; users whose only ruby is the system/OS package; source builds triggered on platforms without bottles.
Related errors
- failed to parse registry option {k} as a TOML value: {e}
- {}: formula has no stable source URL
- {}: source uses the {using:?} download strategy, which mise
- {}: source archive has no sha256 in the API
- {}: API metadata has no ruby_source_path
AI-assisted analysis of jdx/mise@9dcfcaa0dc (2026-08-17).
Data as JSON: /api/errors/7c8647b8a78477ec.
Report an issue: GitHub.