I just installed Rust on Linux. I am so new to Rust that there is no rust and I'm more than rusty at the same time. Following installation I got this in the terminal: To configure your current shell, you need to source the corresponding env file under $HOME/ . cargo
This is usually done by running one of the following (note the leader DOT) $HOME/ .cargo/env ...
Is it asking me to make modifications to the BASH_RC profiles? I am running Debian Bullseye (12). I really am not too sure about modifying BASH, it's been a long long time (circa 2006) since I even tried. I am just getting back into programming and have little Linux administration experience.
Personally I recommend using asdf as for it you need to setup the environment only once and install plugin the same way as others.
Looks like that the rust plugin does not require any additional dependencies, so all you have to do is to add 2 lines to your ~/.bashrc and make sure you have git and curl installed using your OS/distribution package manager.
# inside your ~/.bsshrc
. ~/.asdf/asdf.sh
. ~/.asdf/completions/asdf.bash
Everything you need to know is well explained in getting started documentation on linked page.
Ok, I'll check out the docs, but thanks for helping get the check going. Unfortunately it didn't get added and in my haste I didn't write down the necessaries or take a screenshot like I usually do. I did try the advice here and confirm I'm in bash, which I had presumed, but something is off. So let me check out the docs and thanks again!!
Thanks Eiji I'm acutally trying to figure out how to source Rust.
the bash profile file has an if/then clause built around PATH. Based on what the last guy said I'm going to add the sourcing to the bottom and export it when done. I was in the middle of doing that when my OS decided to act up, so on to try number 2.
Hey guys, thanks again! I figured it out. At first I thought if I allowed the installer to modify the PATH it would source the variables, but no. So all I had to do was follow your instructions quinedot. Quick refreshed on bashrc! Thank you much. SOLVED.
I don't know what's a use case to check PATH in any condition like if.
Your Bash profile should be always loaded once per session, so if you can see a desired path in PATH variable then you do not need to add it to our ~/.bashrc file.
A proper conditions for checking multi-path values in variables like PATH are not so easy. You have to split value of PATH or LD_LIBRARY_PATH or any other variable of this type by : character and declare an array from it. At the end you check if array contains exactly same element as in path you want to check.
However for both answers you don't have to read or change PATH variable as this would be automated by the sourced files like ~/.cargo/env in first answer or ~/.asdf/asdf.sh in my answer.
Thanks for the welcome. working on a book, not the book. It's called rust by example. I have the option for both though, suppose I'll look at the table of contents.