rust - 无法构建Dotenv V0.15.0-使用rust 的 cargo

标签 rust rust-cargo rust-crates

我在尝试构建使用此 crate 的项目时遇到问题。

我正在docker rust:1.44.0内部运行。
我已每晚安装一次:

rustup toolchain install nightly
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: latest update on 2020-06-12, rust version 1.46.0-nightly (a37c32e2d 2020-06-11)
info: downloading component 'cargo'
  5.0 MiB /   5.0 MiB (100 %)   1.5 MiB/s in  2s ETA:  0s
info: downloading component 'rust-std'
 15.9 MiB /  15.9 MiB (100 %)  15.0 MiB/s in  1s ETA:  0s
info: downloading component 'rustc'
 47.3 MiB /  47.3 MiB (100 %)  10.9 MiB/s in  5s ETA:  0s
info: installing component 'cargo'
info: installing component 'rust-std'
 15.9 MiB /  15.9 MiB (100 %)   9.1 MiB/s in  1s ETA:  0s
info: installing component 'rustc'
 47.3 MiB /  47.3 MiB (100 %)   9.9 MiB/s in  4s ETA:  0s

  nightly-x86_64-unknown-linux-gnu installed - rustc 1.46.0-nightly (a37c32e2d 2020-06-11)

info: checking for self-updates

现在它给了我:

 cargo +nightly test
error: failed to download `dotenv v0.15.0`

Caused by:
  unable to get packages from source

Caused by:
  failed to parse manifest at `/usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/dotenv-0.15.0/Cargo.toml`

Caused by:
  readme file with name '../README.md' was not found

我在他们的项目中有一个 Unresolved 问题:
https://github.com/dotenv-rs/dotenv/issues/51

最佳答案

解决此问题的最佳方法是在项目的Cargo.toml中将您对dotenv的依赖关系更改为此


    [dependencies]
    dotenv = { version="0.15.0",git="https://github.com/dotenv-rs/dotenv" }

关于rust - 无法构建Dotenv V0.15.0-使用rust 的 cargo ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62336892/

相关文章:

rust - 如何在 Option 上实现一些方便的方法(例如 flat_map、flatten)?

rust - 索引 &str 时为 "error: mismatched types"

rust - 在 Rust 1.26 中推断存在类型(impl Trait)的生命周期

windows - 如何根据操作系统系列具有不同的依赖关系

rust - 如何清除 cargo 缓存?

rust - 为什么 clap 添加到 Cargo.toml 时无法编译?

rust - Rust 中的组合运算符和管道转发运算符

visual-studio-code - 在 vscode 中带有参数的 RUST cargo 运行任务

rust - `cargo clippy` 是 `cargo check` 的超集吗?

rust - 你如何在 Rust 中读取 YAML 文件?