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

error: could not find Cargo.toml #308

Open
fbaube opened this issue Nov 24, 2024 · 3 comments
Open

error: could not find Cargo.toml #308

fbaube opened this issue Nov 24, 2024 · 3 comments

Comments

@fbaube
Copy link

fbaube commented Nov 24, 2024

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 ?

@calvinrp
Copy link
Collaborator

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

@fbaube
Copy link
Author

fbaube commented Nov 25, 2024

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):

  1. The command cargo build ran successfully, giving me an executable ./target/debug/warg
  2. I inserted the directory ./target/debug/at the head of my PATH
  3. Then this command (from README.md) succeeded: cargo run -p warg-server -- --content-dir content

@calvinrp
Copy link
Collaborator

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.

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