Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 654
twigg Avatar asked Mar 18 '19 22:03

twigg


People also ask

Does Rocket still require Rust nightly?

Installing Rust# Warning: Rocket requires the latest version of Rust nightly.

Is Rust nightly stable?

To sum up: use stable to do normal work; use nightly to experiment with unstable features; use beta to test the next Rust version and get ahead of possible future problems. It is worth saying that the nightly channel is pretty stable and some teams use it in production (after pinning of course).

How do I check my Rust nightly version?

Nightly availabilityUse the rustup-components-history project to find the build status of recent nightly toolchains and components. When you attempt to install or update the nightly channel, rustup will check if a required or previously installed component is missing.


1 Answers

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:

  • What is the stabilization process?
  • error[E0554]: #![feature] may not be used on the stable release channel Couldn't install racer using cargo
  • What is a crate attribute and where do I add it?
like image 63
Shepmaster Avatar answered Sep 21 '22 23:09

Shepmaster