gpt4 book ai didi

rust - 无法构建 Rocket.rs : The given version requirement is invalid

转载 作者:行者123 更新时间:2023-11-29 08:14:13 26 4
gpt4 key购买 nike

我正在关注 the Rocket getting started guide学习 Rust 的 Rocket Web 框架。当我执行 cargo run --verbose 时,出现以下错误:

PS C:\Users\kin\Desktop\hello-rocket> cargo run --verbose
Updating registry `https://github.com/rust-lang/crates.io-index`
failed to parse registry's information for: serde

Caused by:
the given version requirement is invalid

系统详情

Desktop Environment:   Windows 10
Cargo Version : cargo 0.8.0-nightly (28a0cbb 2016-01-17)
rustc Version : rustc 1.7.0 (a5d1e7a59 2016-02-29)

cargo .toml

[package]
name = "hello-rocket"
version = "0.1.0"
authors = ["XXX"]

[dependencies]
rocket = "0.3.5"
rocket_codegen = "0.3.5"

最佳答案

I am following the Rocket getting started guide

very first section of the guide you linked致各州(强调我的):

Rocket makes abundant use of Rust’s syntax extensions and other advanced, unstable features. Because of this, we’ll need to use a nightly version of Rust.

稍后,它指出:

Rocket always requires the latest version of Rust nightly.

然而你有一个稳定版本的 Rust (1.7.0);此时 (2016-02-29) 将近 22 个月。 Rust 1.22.1 是当前 Rust 的稳定版本。

指南继续描述如何安装最新的 nightly;我建议遵循它。

关于rust - 无法构建 Rocket.rs : The given version requirement is invalid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47966985/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com