Compiling bootstrap v0.1.0 (/home/marga/Desktop/Dev/Rust/bootstrap)
error[E0463]: can't find crate for rocket
--> src/main.rs:3:14
|
3 | #[macro_use] extern crate rocket;
| ^^^^^^^^^^^^^^^^^^^^ can't find crate
error: aborting due to previous error
For more information about this error, try rustc --explain E0463.
error: could not compile bootstrap.
To learn more, run the command again with --verbose.
@isaacdarcilla Can you show your Cargo.toml please?
```toml
[package]
name聽=聽"bootstrap"
version聽=聽"0.1.0"
authors聽=聽["isaacdarcilla聽isaacdarcilla@gmail.com"]
edition聽=聽"2018"
[dependencies.rocket_contrib]
rocket聽=聽"0.4.4"
default-features聽=聽false
features聽=聽["handlebars_templates",聽"tera_templates"]```
Here's the Cargo.toml
@isaacdarcilla Can you show your Cargo.toml please?
Your dependency section should look something like this:
[dependencies]
rocket = "0.4.4"
rocket_contrib = { version = "0.4.4", default-features = false, features = [ "handlebars_templates", "tera_templates" ] }
alternatively
[dependencies]
rocket = "0.4.4"
[dependencies.rocket_contrib]
version = "0.4.4"
default-features = false
features = ["handlebars_templates", "tera_templates"]
rocket and rocket_contrib are two diffrent crates, rocket contains the core and rocket_contrib contains nice to haves like templateing and JSON responders.
[dependencies.rocket_contrib] rocket = "0.4.4" default-features = false features = ["handlebars_templates", "tera_templates"]
I think this is "just" a typo: rocket = "0.4.4" should be version = "0.4.4". Please re-open if that doesn't work either!
馃敡 Configured for development.
=> address: localhost
=> port: 8000
=> log: normal
=> workers: 8
=> secret key: generated
=> limits: forms = 32KiB
=> keep-alive: 5s
=> tls: disabled
馃洶 Mounting /:
=> GET / (index)
馃殌 Rocket has launched from http://localhost:8000
Thanks, it worked!
Most helpful comment
@isaacdarcilla Can you show your Cargo.toml please?