I am currently doing a course on APIs in Rust and I followed the course so far but I ran into a problem with rocket_contrib.
This is my exact error message while running cargo run
Updating git repository `https://github.com/SergioBenitez/Rocket`
Updating crates.io index
error: no matching package named `rocket_contrib` found
location searched: https://github.com/SergioBenitez/Rocket
Looks like rocket_contrib was split into separate crates just 5 hours ago. In general depending on the main branch of a repository like this is liable to suddenly cause breakage when changes are made to it. Your options are basically:
[dependencies]
rocket = "0.4"
serde_json = "1.0"
rocket_contrib = { version = "0.4", default-features = false, features = ["json"] }
specify a tag instead of using the latest git commit
[dependencies.rocket_contrib]
git = "https://github.com/SergioBenitez/Rocket"
tag = "some-tag-from-the-git-repo"
default-features = false
features = ["json"]
figure out what changed and update your code to use the new crates instead of rocket_contrib
I would recommend the first choice. Additionally, if these dependencies were specified by the course organizer(s) you may want to let them know they have a bug in their course material.
I see, in that case you could try to depend on both of the new crates rocket_sync_db_pools and rocket_dyn_templates and try to figure out where everything was moved. For example, rocket_contrib::templates::Template is now rocket_dyn_templates::Template and so on. They didn't actually change the contents of the contrib crate as far as I can tell, just moved things around, so hopefully you would be able to get by with just changing some import statements.
thanks for your help. It doesn't seem like I get it running right now because I really lack the skills in rust for now. I reported the problem to the instructor and hope that he will fix the problem.