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

cargo install-update report error: no index found for registry #185

Open
viruscamp opened this issue Aug 29, 2022 · 3 comments
Open

cargo install-update report error: no index found for registry #185

viruscamp opened this issue Aug 29, 2022 · 3 comments

Comments

@viruscamp
Copy link

cargo install-update report error: no index found for registry
but cargo install success.

>cargo install-update bat
    Updating registry 'https://rsproxy.cn/crates.io-index'

Package  Installed  Latest   Needs update
bat      v0.18.3    v0.21.0  Yes

Updating bat
error: no index found for registry: `rsproxy`


Updated 0 packages.
Failed to update bat.
>cargo install bat

Replaced package `bat v0.18.3` with `bat v0.21.0` (executable `bat.exe`)

That is my cargo\config

[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"

replace-with = 'rsproxy'

[source.rsproxy]
registry = "https://rsproxy.cn/crates.io-index"
@nabijaczleweli
Copy link
Owner

This error comes from cargo directly. Can you mv ~/.cargo/registry/rsproxy.cn-* ~/.cargo/registry/rsproxy.cn.old and, run cargo install zupsko (should fail) then cargo install-update bat again?

@cxz888
Copy link

cxz888 commented Aug 30, 2022

This error comes from cargo directly. Can you mv ~/.cargo/registry/rsproxy.cn-* ~/.cargo/registry/rsproxy.cn.old and, run cargo install zupsko (should fail) then cargo install-update bat again?

Did you mean ~/.cargo/registry/index/rsproxy.cn-*? I do so and it doesn't work with the same report.

In fact, following the troubleshooting https://github.com/nabijaczleweli/cargo-update#source-replacement-vs-custom-registries may resolve this, at least it works for me :)

Try to add

[registries.rsproxy]
index = "https://rsproxy.cn/crates.io-index"

to your config.toml.

@viruscamp
Copy link
Author

I think I found the cause: in %CARGO_HOME%\.crates.toml

[v1]
"cargo-expand 1.0.74 (registry+https://rsproxy.cn/crates.io-index)" = ["cargo-expand.exe"]
"irust 1.71.14 (registry+https://github.com/rust-lang/crates.io-index)" = ["irust.exe"]

When I ran cargo install-update --all, cargo-expand had been updated, but it got a failure on irust.

It should be:
cargo install irust without change %CARGO_HOME%\config.toml
edit %CARGO_HOME%\config.toml to use rsproxy
cargo install cargo-expand
cargo install-update --all , it use the info in %CARGO_HOME%\.crates.toml, but it won't update https://github.com/rust-lang/crates.io-index

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

3 participants