error: could not find `Cargo.toml`
Apologies, as this is a n00b question. (My language of choice is Go, not Rust.)
Re. README.md / Getting Started / Running the server:
When I try the command
cargo run -p warg-server -- --content-dir content
I get the error message
error: could not find Cargo.toml in /Users/fbaube/[the execution directory] or any parent directory
What is the correct way to remove this message ?
Ah, I believe those instructions assume that this repo is cloned locally and you're running that command from that directory. Might be your issue
Aha. I neglected to add that I installed warg-cli and warg-server by using cargo at the command line.
But shouldn't they be configured so that they can run standalone and not require a Cargo.toml ?
This certainly seems like a bug.
In any case, I might have solved this (as a workaround):
- The command
cargo buildran successfully, giving me an executable./target/debug/warg - I inserted the directory
./target/debug/at the head of myPATH - Then this command (from
README.md) succeeded:cargo run -p warg-server -- --content-dir content
Cargo.toml is similar to go.mod, it is for build time dependencies. cargo run and cargo build both will be building the project and looking for the Cargo.toml in the workspace directory. Similar to go run and go build.
cargo install warg-server will build and install the binary. Similar to go install. Then you can use those installed binaries in your PATH.