rust-racer 的货物路径设置

Cargo path setup for rust-racer

我刚刚使用 cargo 安装了 racer。安装后这样说:

Installing /home/karthik/.cargo/bin/racer
warning: be sure to add `/home/karthik/.cargo/bin` to your PATH to be able to run the installed binaries

我该怎么做?谷歌搜索没有帮助。另外,我是否也应该为货箱设置一个 PATH 变量?

编辑:OS 是 Ubuntu 14.04,我有超级用户访问权限

您必须将货箱路径添加到您的 PATH 变量,并在 .profile.bash_profile 中设置 RUST_SRC_PATH

Related unix.stackechange question

有两个步骤:

(1) 将货物箱添加到您的 PATH 变量中。您可以 运行 $ whereis cargo 找到 bin 路径,然后执行 $ sudo -H gedit /etc/environment,您可以在其中将新路径部分添加到当前 PATH 变量。您需要保存并关闭文件(您可以在保存部分忽略终端中的错误消息)以使其生效。

(2) 运行 $ rustup component add rust-src 为您下载必要的 Rust 源文件。

此时 Racer 应该可以正常工作了。

这是基于回答