I am new to Rust (and programming in general) but I've heard great things about it.
I tried installing Rust on my Mac today (Monterey 12.3.1) and it gives me an error and says that it's a permissions issue.
I copied the Rust install code into Terminal as per the following:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Once I proceed with the install, thats when the error comes up as follows: error: could not amend shell profile: '/Users/MYUSERNAME/.bash_profile': could not write rcfile file: '/Users/MYUSERNAME/.bash_profile': Permission denied (os error 13)
From Googling around it seems to be a Mac issue, rather than a Rust issue, but would appreciate any assistance to get Rust installed!
Ok thanks. It did open a text editor but it says I don't own the file.
When I run ls -l -a in Terminal, I noticed that the zsh file is assigned to Root.
Could this be the issue? Or am I way off?
Im so confused because I did try and install Rust with Root access, which installed successfully, but when I restarted the Terminal there was no record of Rust being installed.
Huh, it shouldn't be assigned to root. Your personal .zshrc should be owned by you.
In that case you installed it just for the root user. Rustup doesn't do global installations.
If you really can't figure out how to add source ~/.cargo/env to .zshrc, you can run this command every time you open a new terminal window. In that case it will only apply to this terminal window.