twigg
twigg

Reputation: 3993

Rocket requires a minimum version of Rust nightly, but a higher stable version is already installed

I'm trying to run Rocket but I'm falling at the first hurdle. When trying to cargo run, I get the following error:

error: failed to run custom build command for `pear_codegen v0.1.2`
Error: Pear requires a nightly or dev version of Rust.
Installed version is: 1.33.0 (2019-02-28). Minimum required: 1.31.0-nightly (2018-10-05).

I'm new to Rust, but coming from other languages this makes no sense whatsoever. It needs version 1.31.0 as a minimum but I have version 1.33.0 installed.

What am I doing wrong?

Upvotes: 8

Views: 4650

Answers (2)

Alex W
Alex W

Reputation: 38193

You aren't doing anything wrong, Rocket just requires Nightly builds so it has access to newer features of Rust that might've not stabilized yet.

You can opt to only use a Nightly build for your Rocket project, per the documentation:

rustup override set nightly

Getting started guide

Upvotes: 5

Shepmaster
Shepmaster

Reputation: 430791

If software requires a nightly build of Rust, no stable version of Rust can be substituted: you are required to use nightly.

The nightly channel of Rust is a superset of stable Rust. Features that are not yet complete or simply haven't proven their value are included in nightly builds of Rust. You opt into using a given feature via a crate attribute.

These unstable features may completely change or even be removed at any time. Said another way, an unstable feature is never guaranteed to exist in any particular Rust stable version.

If it helps, you can think of nightly versions as an "alternate reality" track of development. The version number of nightly is only a loose indicator of where they exist in time; the compilation date and git commit hash are much more informative.

I would have thought the nightly code from 1.31.0 would be pushed into the stable 1.31.0+ versions once tested

This is how the beta channel works — anything in 1.x.y-beta will be in 1.x.y-stable (assuming no major emergency occurs).

See also:

Upvotes: 14

Related Questions