Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'rustlings' is not recognized as an internal or external command, operable program or batch file. #704

Closed
ghost opened this issue Apr 17, 2021 · 11 comments

Comments

@ghost
Copy link

ghost commented Apr 17, 2021

I must've missed a step in installing rustlings, I am using windows 10 and ran all of the commands to install and when I ran the 'rustlings' command it seems that it doesn't know what it is. I tried editing the PATH's but it still doesn't seem to work.

@Zerotask
Copy link
Contributor

Hello @captainmaps what's your OS, which versions of Rust and Cargo do you use and how did you install Rustlings? Did you get any errors?

I installed it 2 days ago as following:

  1. git clone https://github.com/rust-lang/rustlings
  2. cd rustlings
  3. cargo install --force --path .

as described here: https://github.com/rust-lang/rustlings#manually

After it, I was able to run rustlings.

@ghost
Copy link
Author

ghost commented Apr 17, 2021

I use windows 10 and I use the stable build of rust. do you run command 3 like that or do you have to put a path at the end of it? I did use powershell to install it, but some error still happen.

PS C:\WINDOWS\system32\rustlings> cargo install --force --path C:\WINDOWS\system32\rustlings
warning: could not canonicalize path: 'C:\WINDOWS\system32\rustlings'
Installing rustlings v4.3.0 (C:\WINDOWS\system32\rustlings)
Updating crates.io index
warning: spurious network error (2 tries remaining): failed to read data: The connection with the server was terminated abnormally
; class=Os (2)
warning: spurious network error (1 tries remaining): failed to send request: The server name or address could not be resolved
; class=Os (2)
error: failed to compile rustlings v4.3.0 (C:\WINDOWS\system32\rustlings), intermediate artifacts can be found at C:\WINDOWS\system32\rustlings\target

Caused by:
failed to get clap as a dependency of package rustlings v4.3.0 (C:\WINDOWS\system32\rustlings)

Caused by:
failed to load source for dependency clap

Caused by:
Unable to update registry https://github.com/rust-lang/crates.io-index

Caused by:
failed to fetch https://github.com/rust-lang/crates.io-index

Caused by:
failed to send request: The server name or address could not be resolved
; class=Os (2)

@Zerotask
Copy link
Contributor

Zerotask commented Apr 17, 2021

do you run command 3 like that or do you have to put a path at the end of it?

The path is the dot . which points to the current directory - and previously I switched to that directory.

Your error is the path:

could not canonicalize path: 'C:\WINDOWS\system32\rustlings'

The backslash is often used for escaping chars. So either try it with a dobule backslash, a normal slash or with the dot .
cargo install --force --path .

@ghost
Copy link
Author

ghost commented Apr 17, 2021

I tried it with the dot but this warning still comes up:

PS C:\WINDOWS\system32\rustlings> cargo install --force --path .
warning: could not canonicalize path: 'C:\WINDOWS\system32\rustlings'

I stopped the command after that.

@Zerotask
Copy link
Contributor

Zerotask commented Apr 17, 2021

This issue is probably related to rust-lang/rustup#999 rust-lang/rustup#682

I just re-run the 3 installation steps and it worked as expected. Since your error stack also consists of multiple warning: spurious network error, it could also something related to a proxy or antivirus program.

btw I'm using PoweShell Core: https://github.com/powershell/powershell

@ghost
Copy link
Author

ghost commented Apr 17, 2021

could the execution policy have something to do with this? I think those are affecting scripts running and I have it restricted.

Nope. No difference.

@ghost
Copy link
Author

ghost commented Apr 17, 2021

I tried the other method for installing and this is what I found:

PS C:\WINDOWS\system32> Start-BitsTransfer -Source https://git.io/JTL5v -Destination $env:TMP/install_rustlings.ps1; Unblock-File $env:TMP/install_rustlings.ps1; Invoke-Expression $env:TMP/install_rustlings.ps1
Let's get you set up with Rustlings!
Checking requirements...
SUCCESS: Git is installed
SUCCESS: Rust is installed
SUCCESS: Cargo is installed
SUCCESS: Rust is up to date
Cloning Rustlings at C:\WINDOWS\system32/rustlings
error: RPC failed; curl 56 OpenSSL SSL_read: Connection was reset, errno 10054
error: 1142 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output

I don't know if this error is the same as the last method.

@Zerotask
Copy link
Contributor

Zerotask commented Apr 17, 2021

Can you check out this solution https://stackoverflow.com/questions/46232906/git-clone-error-rpc-failed-curl-56-openssl-ssl-read-ssl-error-syscall-errno

But they also state, that it's likely a problem with antivirus, firewall, outdated Software etc

#668 could also be the solution for you.

@ghost
Copy link
Author

ghost commented Apr 17, 2021

I did have a similar problem before though, it was about an app called itch. It had an error about installing butler. My solution for it was manually downloading butler and putting in the PATH's. Maybe I can do a similar solution to this one.

@ghost
Copy link
Author

ghost commented Apr 17, 2021

The problem here is that the rustlings command doesn't work. The exercises part is working fine, but compiling is where it would take so long. The amount of time it takes to compile coupled with frequently needing to check is not gonna be good. Hence why I need the rustlings command. It checks at intervals so I don't have to wait that long just to know if my solution is right or wrong.

@ghost
Copy link
Author

ghost commented Apr 20, 2021

I finally did it!!! all I had to do was not launch Powershell in administrator and use a different path for installation.

@ghost ghost closed this as completed Apr 20, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant