rustup 安装在哪里? [英] Where does rustup install itself to?

查看:112
本文介绍了rustup 安装在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 rustuprustccargo 二进制文件安装到 ~/.cargo/bin,但是它在哪里安装 rustup 可执行文件?据我所知,这在任何文档中都没有解释,运行安装程序也不会告诉你.如果可能的话,我想避免将它安装到我的主目录以外的任何地方.如果这有所不同,我将使用 macOS.

I understand that rustup installs the rustc and cargo binaries to ~/.cargo/bin, but where does it install the rustup executable to? As far as I can tell this isn't explained in any documentation and running the installer doesn't tell you either. I'd like to avoid it being installed to anywhere except my home directory, if possible. I'm using macOS if that makes a difference.

推荐答案

默认,rustup 也会安装到你的主目录:

By default, rustup is also installed to your home directory:

$ which rustup
/Users/shep/.cargo/bin/rustup

文档说明:

rustup 安装 rustccargorustup 等标准工具到 Cargo 的 bin目录.在 Unix 上它位于 $HOME/.cargo/bin,在 Windows 上位于 %USERPROFILE%\.cargo\bin.这与 cargo install 将安装 Rust 程序和 Cargo 插件的目录相同.

rustup installs rustc, cargo, rustup and other standard tools to Cargo's bin directory. On Unix it is located at $HOME/.cargo/bin and on Windows at %USERPROFILE%\.cargo\bin. This is the same directory that cargo install will install Rust programs and Cargo plugins.

继续描述如何更改默认值:

rustup 允许您在运行 rustup-init 可执行文件之前通过设置环境变量 CARGO_HOMERUSTUP_HOME 来自定义安装.如环境变量部分所述,RUSTUP_HOME 设置根 rustup 文件夹,用于存储已安装的工具链和配置选项.CARGO_HOME 包含货物使用的缓存文件.

rustup allows you to customise your installation by setting the environment variables CARGO_HOME and RUSTUP_HOME before running the rustup-init executable. As mentioned in the Environment Variables section, RUSTUP_HOME sets the root rustup folder, which is used for storing installed toolchains and configuration options. CARGO_HOME contains cache files used by cargo.

这篇关于rustup 安装在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆