Search code examples
rustterminalrust-cargofish

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:

Rust is installed now. Great!

To get started you need Cargo's bin directory in your PATH environment variable. Next time you log in this will be done automatically. The next time I logged in Cargo was not in my PATH. I had to add it manually.

In my .config/fish/fish.config file I have a:

set -x PATH ...

line where I had to manually add cargo bin's:

set -x PATH ... .cargo/bin


Solution

    1. run the fish_add_path command

    fish_add_path /home/your-username/.cargo/bin/

    my path: fish_add_path /Users/aharo/.cargo/bin/
    
    1. restart terminal/shell
    2. Run rustc