rustlings
rustlings copied to clipboard
rustling rampup for .asdf users
Hello! I guess we need to add in README an info how to start when your Rust has been installed via asdf.
It wasn't that obvious from first glance why rustlings run tests1
said zsh: commang not found: rustlings
.
I've added $PATH in my .zshrc
- did not help.
Looks (and feels) like the core of the problem lays somewhere in .asdf
because I've installed rust via ASDF.
I bet I'm not the only one who faces this asdf-related issue at the step 0 of rust journey.
> dotfiles git:(master): rustlings
> zsh: command not found: rustlings
> dotfiles git:(master): which cargo
> /Users/macbook/.asdf/shims/cargo
Looks like if you've installed Rust via asdf, the PATH should look like this
export PATH=/Users/username/.asdf/shims:$PATH
because the last few sentences in rustlings/install.sh
said WARNING: Please check that you have '/Users/macbook/.cargo/bin' in your PATH environment variable!
Is it correct?
I am getting a similar error.
I have asdf rust installed with cargo
version 1.71.0, rustup
1.26.0.
Both are in the /Users/user/.asdf/shims/.
path when I run the which
command.
Install works without error, but can't run the program...
%> rustlings
zsh: command not found: rustlings
Workaround
As a work around, it shouldn't surprise one to find the release binary in the
[path to rustlings]/rustlings/target/release
directory.
I just call this direct e.g. ./target/release/rustlings list
hope that helps...
I will say that I am of the general opinion that Rust, if not installed via a system package manager, should be installed via Rustup, as it's the project's official tool, and also includes a release track and components system, which is indispensable for advanced uses. I'm not sure how asdf handles shims, but unless they actually modify Cargo's source code, Cargo will always install binaries into ~/.cargo/bin
.
I had this issue as well I fixed it by configuring the PATH variable with asdf path to the rust version and the shims folder.
export PATH=$HOME/.local/bin/:/usr/local/bin/:$HOME/.asdf/installs/rust/stable/bin/:$HOME/.asdf/shims/:$PATH
After this I executed the script to install the rustlings again and it worked
I am getting a similar error. I have asdf rust installed with
cargo
version 1.71.0,rustup
1.26.0. Both are in the/Users/user/.asdf/shims/.
path when I run thewhich
command.Install works without error, but can't run the program...
%> rustlings zsh: command not found: rustlings
Workaround
As a work around, it shouldn't surprise one to find the release binary in the
[path to rustlings]/rustlings/target/release
directory. I just call this direct e.g../target/release/rustlings list
hope that helps...
In my case, this is ths solution! Thank you!
Closing because of the solution in the comments.