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 initialisation failed -- arch linux #2046

Closed
Sitkaskidding opened this issue Jul 12, 2024 · 5 comments
Closed

Rustlings initialisation failed -- arch linux #2046

Sitkaskidding opened this issue Jul 12, 2024 · 5 comments

Comments

@Sitkaskidding
Copy link

I am attempting to follow the installation instructions on the README.However when entering the command rustlings init i get the error "-bash: rustlings: command not found". Any other variations of the rustlings command e.g. rustlings --help or rustlings --version produces the same output

  • I am using the arch linux lts kernel and ran sudo pacman -Syu immediately before attempting installation so all packages should be up to date
  • I am using rustc version 1.79.0 and cargo version 1.79.0
  • Cargo appears to be installed successfully and can create, build and run projects
  • The step cargo install rustlings appears to complete successfully
  • I have attempted uninstalling and reinstalling the rustlings package however the issue persists

Thank you very much for your time

@mo8it
Copy link
Contributor

mo8it commented Jul 12, 2024

Can you please share the output of echo $PATH?

@mo8it
Copy link
Contributor

mo8it commented Jul 12, 2024

Did you install Rust using pacman instead of rustup?

Can you please share the output of cat ~/.cargo/env and ls ~/.cargo/bin?

@Sitkaskidding
Copy link
Author

To be perfectly honest I cannot remember if I installed Rust using pacman or rustup. Is there some way to check?

echo $PATH outputs /usr/local/bin:/usr/bin:/usr/local/sbin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/lib/rustup/bin
cat ~/.cargo/env outputs No such file or directory
ls ~/.cargo/bin outputs mdbook rustlings

@mo8it
Copy link
Contributor

mo8it commented Jul 12, 2024

It looks like Rust was installed using pacman and it didn't add ~/.cargo/bin to your PATH environment variable. You see that rustlings is already installed in ~/.cargo/bin but it can't be found.
Either add ~/.cargo/bin manually to PATH or uninstall Rust from pacman and install it using the official way.

I will close the issue. But if you still need any help, don't hesitate to comment :)

@mo8it mo8it closed this as completed Jul 12, 2024
@mo8it
Copy link
Contributor

mo8it commented Jul 12, 2024

See this section and what it says about ~/.cargo/bin in PATH. I think that Arch should just add ~/.cargo/bin to your PATH as intended instead of doing things its own way…

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

2 participants