0

I'm on MacO Big Sur, just have the latest stable Rust installed via:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

No, I don't use Homebrew. Then I want to compile xv6-rust. It needs the nightly version, with extra component rust-src. I already switch to nightly:

$ rustc --version

rustc 1.60.0-nightly (777bb86bc 2022-01-20)

Now the problem is: how to install rust-src?

$ rustup component add rust-src

error: error: Found argument 'component' which wasn't expected, or isn't valid in this > context

USAGE: rustup-init [FLAGS] [OPTIONS]

3
  • rustup-init is the installer for Rustup itself -- it shouldn't be on your $PATH, or even really exist once you've installed Rustup. Perhaps you downloaded the installer script and added that to your path? The file you download from sh.rustup.rs is an installer for Rustup, not Rustup itself. Commented Jan 22, 2022 at 0:57
  • OK. After running locate rust-init, seems like I forgot that rustup-init was already installed via homebrew. Then I uninstalled it: brew uninstall rustup-init. Another issue come, when running rustup component add rust-src again, I got this: "zsh: command not found: rustup-init" Commented Jan 22, 2022 at 3:07
  • Found the culprit. In my .zshrc, there's this line: alias rustup=rustup-init. I didn't exactly remember doing that. Or perhaps mixing manual installation with homebrew isn't always a good idea? Removed that line and now rustup works fine. Commented Jan 22, 2022 at 3:53

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.