Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'System is not running' for actix_rt 2.0.2

I attempted to update to actix_rt 2.0.2 and have since been getting the following error:

thread 'main' panicked at 'System is not running'

Here is my minimal example:

# Cargo.toml
[dependencies]
actix = "0.10"
actix-web = { version = "3.3.2", default-features = false }
actix-rt = "2.0.2"
//! main.rs
use actix_rt;
use actix_web::{HttpServer, App, HttpResponse};

async fn hello() -> HttpResponse {
    HttpResponse::Ok().finish()
}

#[actix_rt::main]
async fn main() -> std::io::Result<()> {
    let server = HttpServer::new(move || {
        App::new().route("/", actix_web::web::get().to(hello))
    });
    server.bind("127.0.0.1:8080")?.run().await
}

I'm assuming it must be some version incompatibilities between the actix crates. I need actix_rt 2.0.x so that I can integrate with Criterion.

Is there a combination of version numbers to get these to work together?

like image 728
Marcus Ruddick Avatar asked Feb 21 '21 07:02

Marcus Ruddick


2 Answers

You have incompatible versions of actix crates. You can either downgrade actix-rt to 1, or upgrade to beta versions like:

actix = "0.11.0-beta.2"
actix-web = "4.0.0-beta.3"
actix-rt = "2.0.2"
like image 116
Max Avatar answered Oct 21 '22 05:10

Max


Use these dependencies in your cargo.toml file:

actix = "0.11.0"
actix-web = "3.3.2"
actix-rt = "1.1.1"
like image 22
Rony Setyawan Avatar answered Oct 21 '22 06:10

Rony Setyawan