Skip to content

Can't install via cargo install; Cargo ignores clap version #42

@pierzchalski

Description

@pierzchalski

This is a weird one. I can clone the project and build it locally just fine, but if I try and install it from crates.io with cargo install rust-script (or from a local checkout with cargo install --path .) I get a bunch of errors like the following:

   ...
   Compiling clap v3.0.0-rc.0
   ...
   Compiling rust-script v0.18.0
error[E0599]: no method named `about` found for struct `Arg` in the current scope
   --> /home/eap/.cargo/registry/src/github.com-1ecc6299db9ec823/rust-script-0.18.0/src/main.rs:109:18
    |
109 |                 .about("Script file or expression to execute.")
    |                  ^^^^^ method not found in `Arg<'_>`

error[E0599]: no method named `about` found for struct `Arg` in the current scope
   --> /home/eap/.cargo/registry/src/github.com-1ecc6299db9ec823/rust-script-0.18.0/src/main.rs:123:18
    |
123 |                 .about("Execute <script> as a literal expression and display the result.")
    |                  ^^^^^ method not found in `Arg<'_>`
    ...

Looks like Cargo.toml specifies clap-3.0.0-beta.5 which indeed has the Arg::about method, but as you can see above cargo install tries to use clap-3.0.0-rc.0 which does not have Arg::about. Why would Cargo be doing this? Is there a workaround?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions