Problem installing Rust

Hello

I installed Rust following this guide:

"On Windows, go to Install Rust - Rust Programming Language and follow the instructions for installing Rust. At some point in the installation, you’ll be prompted to install Visual Studio. This provides a linker and the native libraries needed to compile programs. If you need more help with this step, see https://rust-lang.github.io/rustup/installation/windows-msvc.html." I did this.

However when I open shell and type in this command, as highlighted in the guide:

" To check whether you have Rust installed correctly, open a shell and enter this line:"


$ rustc --version

I get the following error message:

"$ : "$" wasn't recognized as the name of a Cmdlet of a function, a script file or an executable program. Please check the spelling of the name, whether the path is correct (if available) and repeat the process.
In Zeile:1 Zeichen:1

  • $ rustc --version
  • ~
    • CategoryInfo : ObjectNotFound: ($:String) , CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException"

I'm running Windows 11 Home.

Would be thankful for any points.

Cheers, a Newbie

Don't type the $, type only rustc --version

$ indicates the prompt, the line where you're typing, not part of what you actually type.

Thanks for the reply. Judging by my misunderstanding of basic syntax I'm guessing that I'm overreaching learning programming lanugage, computer science etc. by starting out with Rust. The local documentation file actually agrees with this:

"If you’d like to learn Rust, this is the section for you! All of these resources assume that you have programmed before, but not in any specific language:"

You can write and run some basic programs in the playground, if you want a simpler way to get started.

Judging by my misunderstanding of basic syntax I'm guessing that I'm overreaching

understanding the syntax of your shell and programming are 2 unrelated skills, and if you're told to copy a piece of text, and you're not told to skip a symbol, then literally copying the text in its entirety is perfectly reasonable.

i've already published 2 small crates and most of the time i use cp (copies a file), ln (makes a symlink or hardlink), etc i need to open the manual to look up which argument is the source, and which is the destination,
and when i use ln there's a 50% chance that i forget -s and make a hardlink on accident :ferris_melt:

The local documentation file actually agrees with this

not exactly, it says that the book assumes that you already have some programming experience, meaning it won't need to explain control flow, scoping, the heap and stack, etc in detail;
it does not say that learning rust requires prior experience in programming, only that the book assumes it.

so a lack of prior programming experience means that you will need to learn everything the book assumes you know or doesn't teach while learning rust, not that you can't learn rust.

i would argue that rust can be better for starting with programming than a lot of languages commonly used to teach programming (delphi, C, C++, fortran, java), its just that a clear "i have no experience, how do i learn rust" book is missing, making it more difficult to find the information you need.

i would recommend CS50x (a free programming course by harvard, you can sign up, but you can also just watch the lectures on youtube) for learning the basics of computer science and using the rust book to learn rust.

it's less important what's your background is. some people learn new stuff really really fast.

if you learn programming for jobs, then I'd say your time would be better spent if you take dedicated classes, preferably in person, but remote or online is fine, if you have trouble find a local programming school.

if you learn programming for fun, you can do whatever you enjoy the most. rust can be frustrating to get started, but if you persist, eventually you'll get tremendous joy programming in it.

it is usually suggested to start with the book for new learners.

I'd also recommend new learners to go through rust by example first, to get a "feel" of the language, it has faster pace than the book. you should be able finish it in a day or two.

your goal is NOT to understand each example during the first read. human brain is very good at pattern recognition, if you give it enough input to process. (in this regard, similar techniques are used to learn foreign langauges by many).

it's important to not break the flow. if you don't know what a piece of code does, just take a guess and move on, don't stop to look it up until you finish all the chapters.

Having the unix-like prompt character $ there is definitely misleading to newbies, especially those using Windows cmd.exe or PowerShell which have no $ in the default prompt at all. When you see it in documentation or similar text, it’s something of an idiom that means "the string following the $ should go to a command line" but that’s sort of tacit knowledge that must be learned first.

(Now, there are good reasons to install a unix-like shell and core utilities on Windows too, but that can wait until you have a bit more experience.)

the book says

Command Line Notation

In this chapter and throughout the book, we’ll show some commands used in the terminal. Lines that you should enter in a terminal all start with $. You don’t need to type the $

"don't need" implies that its unnecessary, but otherwise harmless to do; which is misleading.
it should say MUST NOT (bold and uppercase so that its more difficult to miss, maybe also in red to make it even more difficult to miss)

I like the idea of styling so it's easier to catch your eye, but the phrasing "MUST NOT" seems a bit too strong.

Maybe have a troubleshooting aside section next to the first few entrypoints running commands (places people might skip to in the books first chapters) to mention "if you get an error about "$", remember: don't type the dollar sign, just type everything after it"

maybe should not, still bold and easy to say, but less extreme

Not a "rust" answer but...

I would strongly suggest you try out a basic gnu/linux system to enhance your leaning path.

If you really want to get into "programming".

If you have a linux system install, you can go through the linux from scratch book and when you are done you will be fully adept in how to use your command line, how to compile, and many other things that will make your future programming education much easier.