{"record":{"id":"d8fdbfa98920bc9d","repo":"nikivdev/code","slug":"direnv-is-not-on-path-install-it-from-https-dir","errorCode":null,"errorMessage":"direnv is not on PATH. Install it from https://direnv.net/#installation and rerun `flow doctor`.","messagePattern":"direnv is not on PATH\\. Install it from https://direnv\\.net/#installation and rerun `flow doctor`\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/doctor.rs","lineNumber":116,"sourceCode":"    vcs::ensure_jj_installed()?;\n    println!(\"✅ jj found on PATH\");\n    Ok(())\n}\n\nfn ensure_direnv_on_path(zerobrew_available: bool) -> Result<()> {\n    match which::which(\"direnv\") {\n        Ok(path) => {\n            println!(\"✅ direnv found at {}\", path.display());\n            Ok(())\n        }\n        Err(_) => {\n            if maybe_install_with_zerobrew(zerobrew_available, \"direnv\", \"direnv\")? {\n                if let Ok(path) = which::which(\"direnv\") {\n                    println!(\"✅ direnv installed via zerobrew at {}\", path.display());\n                    return Ok(());\n                }\n            }\n            bail!(\n                \"direnv is not on PATH. Install it from https://direnv.net/#installation and rerun `flow doctor`.\"\n            )\n        }\n    }\n}\n\nfn find_bundled_lin() -> Option<PathBuf> {\n    let exe_dir = std::env::current_exe()\n        .ok()\n        .and_then(|p| p.parent().map(PathBuf::from))?;\n    let candidate = exe_dir.join(\"lin\");\n    if candidate.exists() {\n        Some(candidate)\n    } else {\n        None\n    }\n}\n","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/doctor.rs#L98-L134","documentation":"flow doctor requires direnv for environment loading. ensure_direnv_on_path checks `which direnv`; before failing it attempts an automatic install via zerobrew. If that install fails or does not put direnv on PATH, it bails with the official install link.","triggerScenarios":"Running `flow doctor` when direnv is not on PATH and the zerobrew auto-install either was skipped (zerobrew unavailable), reported failure, or installed to a directory not on PATH.","commonSituations":"Fresh machine setup, zerobrew not installed so auto-install cannot happen, or direnv installed via an unsupported package manager to a non-PATH location.","solutions":["Install direnv per https://direnv.net/#installation and rerun `flow doctor`","Install zerobrew first so the doctor's automatic direnv install can run","Add direnv's install location to your PATH"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if which::which(\"direnv\").is_err() {\n    eprintln!(\"direnv missing; install from https://direnv.net/#installation\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install direnv via your package manager during setup","Ensure zerobrew is available if you rely on the doctor's auto-install","Confirm `direnv hook` is wired into your shell and the binary resolves"],"tags":["missing-binary","path","environment","direnv"],"backgroundTag":"binary-not-on-path","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}