知识卡片
安装 Cargo 工具二进制
用 cargo install 包名 安装有二进制目标的工具。它写到安装根的 bin,终端需要通过 PATH 找到该目录。包名和命令名可以不同,例如 ripgrep 对应 rg。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 深入 Cargo 与 Crates.io Installing Binaries with cargo install · 查看原书依据
The cargo install command allows you to install and use binary crates locally. This isn’t intended to replace system packages; it’s meant to be a convenient way for Rust developers to install tools that others have shared on https://crates.io. Note that you can only install packages that have binary targets.
参考来源
- 位置:《The Rust Programming Language(第2版)》第14章 深入 Cargo 与 Crates.io(来源项目 a19c7933-4eda-4176-aebd-30fe7e1ad292,`extracted/The Rust Programming Language(第2版)/_epub-src/c14.xhtml`,块 0185)
- 结论依据:原文区分能安装运行的二进制目标和可供程序依赖的库目标。
- 原始内容:The cargo install command allows you to install and use binary crates locally. This isn’t intended to replace system packages; it’s meant to be a convenient way for Rust developers to install tools that others have shared on https://crates.io. Note that you can only install packages that have binary targets.