提问人:Dmitry 提问时间:10/17/2023 最后编辑:cafce25Dmitry 更新时间:10/19/2023 访问量:31
在 linux 中安装serde_json依赖项时出错 [已关闭]
Error installing serde_json dependency in linux [closed]
问:
我在 Windows 上编写 Rust 代码,然后将其发送到安装了 Debian GNU/Linux 11 的 VPS 服务器。在构建项目时,我收到与安装serde_json相关的错误:
error: failed to download `serde_json v1.0.107`
Caused by:
unable to get packages from source
Caused by:
failed to parse manifest at `/root/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_json-1.0.107/Cargo.toml`
Caused by:
failed to parse the `edition` key
Caused by:
this version of Cargo is older than the `2021` edition, and only supports `2015` and `2018` editions.
我的Cargo.toml:
[package]
name = "hello_rust"
version = "0.1.0"
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
serde = "1.0"
serde_json = "1.0"
我尝试使用货物更新来更新货物。并serde_json删除 '/root/.cargo/registry/src/github... / ... 奇怪的是,我没有将生锈与货物和生锈一起安装。我还尝试明确更改serde_json的版本,但仍然出现了相同的错误。我不明白是什么原因,请帮忙。
答: 暂无答案
评论
serde_json
cargo update
cargo