Why this happen? every time i create .rs file and wanna save it in VS codium. I must be a super user. As a beginner i got many error, it come to change the code. For run the code i must save the file first.
Those errors have nothing to do with Rust, but with your operating system's file permissions.
One suggestion I can give you is to enable auto-save, so that you don't need to save each file manually.
Thanks, how to make an auto save?
I would ask my search engine of preference.
you got me hahah, sure thanks
Uuuh, that's not really a good idea. VS Codium gives bad advice here. It looks like this tool was written by developers with Windows in mind, where working as super user is done more often, which opens security issues.
The appropriate solution would be to fix ownership and permissions. All files in the project folder should be owned by yourself. Find files and directories not owned by yourself with
$ find /home/qoori/Documents/Rust ! -user qoori
Find files and directories not writable by you with
$ find /home/qoori/Documents/Rust ! -writable
Inside the terminal, you're logged in as root
, not qoori
. It could be possible that you created the project (ran cargo new) as root as well, which creates the files with unusable permissions.
I'd advise you to only use sudo when you know exactly what you're doing, you'll save yourself a lot of hassle.
I think OP using sudo when creating the file was the most likely cause of the issue. @qoori are you also new to using Linux? If so, we can help a little with managing file permissions as well.
I've been daily-driving VSCodium on Ubuntu for about a year now, so I can help with most common questions.
yes i am new, please help me
yes beacuse if not root. The cargo is missing.
cargo new load
Command 'cargo' not found, but can be installed with:
sudo snap install rustup # version 1.24.3, or
sudo apt install cargo # version 0.67.1+ds0ubuntu0.libgit2-0ubuntu0.22.04.2
See 'snap info rustup' for additional versions.
In root mode, the cargo is exist.
That’s even more bizarre. Try running the following commands:
which rustup
sudo which rustup
This will tell you where your rustup installation lives.
Seems like you ran rustup as root as well. As you can see, using sudo in the wrong moment can cause lots of issues.
qoori@Levianthen:~$ which rustup
qoori@Levianthen:~$ sudo which rustup
[sudo] password for qoori:
I was try it and the path of installation is not showed up
You will need to reinstall Rustup from the start (https://rustup.rs), but without sudo. (You should not have used sudo to install Rustup in the first place.)
thank, lemme try