简体   繁体   English

货箱未添加到路径(鱼 shell)

[英]Cargo bin's not added to path ( fish shell )

I'm using the fish shell under MacOS X Capitan and after using rustup.rs I get the following message:我在 MacOS X Capitan 下使用鱼 shell,在使用 rustup.rs 后,我收到以下消息:

Rust is installed now. Rust 现已安装。 Great!伟大的!

To get started you need Cargo's bin directory in your PATH environment variable.要开始,您需要 PATH 环境变量中的 Cargo 的 bin 目录。 Next time you log in this will be done automatically.下次您登录时,这将自动完成。 The next time I logged in Cargo was not in my PATH.下次我登录时,Cargo 不在我的 PATH 中。 I had to add it manually.我不得不手动添加它。

In my.config/fish/fish.config file I have a:在 my.config/fish/fish.config 文件中,我有一个:

set -x PATH...设置 -x 路径...

line where I had to manually add cargo bin's:我必须手动添加货箱的行:

set -x PATH... .cargo/bin设置-x 路径....cargo/bin

  1. run the fish_add_path command运行fish_add_path命令

fish_add_path /home/your-username/.cargo/bin/ fish_add_path /home/你的用户名/.cargo/bin/

my path: fish_add_path /Users/aharo/.cargo/bin/
  1. restart terminal/shell重新启动终端/外壳
  2. Run rustc运行rustc

Follow the steps按照步骤

  1. Open file ~/.config/fish/config.fish ;打开文件~/.config/fish/config.fish
  2. Add the line set PATH $PATH ~/.cargo/bin ;添加行set PATH $PATH ~/.cargo/bin and
  3. Restart fish terminal重启鱼终端

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM