Rust "toolchain `x` is not installed" in CI
A command requested a specific toolchain (a channel like nightly, or a pinned version) that rustup does not have installed. rustup refuses to run rather than silently picking another toolchain.
What this error means
cargo or rustup fails with error: toolchain '<name>' is not installed. It happens when a +nightly invocation, a rust-toolchain.toml, or an override names a channel the runner never installed.
error: toolchain 'nightly-x86_64-unknown-linux-gnu' is not installed
help: run `rustup toolchain install nightly-x86_64-unknown-linux-gnu` to install itCommon causes
Requested channel never installed
A cargo +nightly ..., a rust-toolchain.toml, or a rustup override points at a toolchain that was never installed on this runner.
Pinned version absent from the image
A pinned version (e.g. 1.79.0) is requested but the runner only has stable. rustup has nothing matching the exact name.
How to fix it
Install the requested toolchain
rustup’s own help line names the exact install command.
rustup toolchain install nightly
# or a pinned version
rustup toolchain install 1.79.0Request it via the setup action
Let the toolchain action install the channel your project needs.
- uses: dtolnay/rust-toolchain@nightly
# or pinned:
- uses: dtolnay/rust-toolchain@1.79.0How to prevent it
- Install every channel your build references (including
nightlyfor+nightlysteps). - Use a toolchain action that installs the channel automatically.
- Keep
rust-toolchain.tomlin sync with what CI installs.