BlogEx
BACK TO FEED
2024.01.08 ● PUBLIC

'One of the features must be enabled' error when adding sqlx

rustsqlxdebug

And how I've fixed it.

SYMPTOMS

When installing sqlx-cli on MacOS with:

cargo install --version=0.6.2 sqlx-cli --no-default-features --features postgres

The following error happens:

Compiling base64 v0.13.1
error: one of the features ['runtime-actix-native-tls', 'runtime-async-std-native-tls', 'runtime-tokio-native-tls', 'runtime-actix-rustls', 'runtime-async-std-rustls', 'runtime-tokio-rustls'] must be enabled
--> /Users/jakub.sokolowski/.cargo/registry/src/github.com-1ecc6299db9ec823/sqlx-rt-0.6.3/src/lib.rs:11:1
|
11 | / compile_error!(
12 | | "one of the features ['runtime-actix-native-tls', 'runtime-async-std-native-tls', \
13 | | 'runtime-tokio-native-tls', 'runtime-actix-rustls', 'runtime-async-std-rustls', \
14 | | 'runtime-tokio-rustls'] must be enabled"
15 | | );
| | |_^

FIX

I've removed all of the flags, and the installation went smoothly:

cargo install sqlx-cli