Closed slondr closed 4 years ago
Thanks for the report @slondr
It sounds like the bin didn't get auto-installed correctly. Could you run the below command from your terminal and share the output?
cargo install rusty-hook
@calebcartwright
Updating crates.io index
Ignored package `rusty-hook v0.11.1` is already installed, use --force to override
Running the command with --force
did not fix the error
and what about
rusty-hook --version
zsh: command not found: rusty-hook
that'd explain it then. do you have ~/.cargo/bin
on your path?
Nope. Should I?
Yes, the rusty-hook
bin needs to be on your path. Did you use rustup
to install rust on your system?
I believe I did.
Adding .cargo/bin to my path works when I use git via the command line, but doesn't work when I use a git front-end that spawns its own shells (like magit does).
It sounds like there's a rust config/setup issue with your environment. You'll always want to have cargo's bin directory on your path, and IIRC rustup does this as part of your setup (though I think there's an issue with fish)
I'm not familiar with magit, but as long as the shells it spawns have cargo's bin dir available (presumably via some profile or explicit config) then things should work
@slondr Thanks again for reaching out. We've added a note to the readme docs to call out the requirement for having cargo's bin dir on your path, with a pointer to the official install instructions for more information.
There's not really much else we can do on the rusty-hook side, so I'm going to go ahead and close this. Please feel free to reach out though if you have any questions!
https://www.rust-lang.org/tools/install
Configuring the PATH environment variable
In the Rust development environment, all tools are installed to the ~/.cargo/bin directory, and this is where you will find the Rust toolchain, including rustc, cargo, and rustup.
Accordingly, it is customary for Rust developers to include this directory in their PATH environment variable. During installation rustup will attempt to configure the PATH. Because of differences between platforms, command shells, and bugs in rustup, the modifications to PATH may not take effect until the console is restarted, or the user is logged out, or it may not succeed at all.
Hey just wanna follow up for anyone who ends up here, this was a problem for me, I installed rust using ASDF so I'd imagine the problem lies in the way that ASDF sets up the cargo shim vs how rusty-hook expects to find it... not gonna reopen cuz it seems like a me problem 😄 but hopefully this helps someone!
Environment Details
Description
After following the steps in the readme, any git commit gives the following error message: