我正在使用 Mac M1。我已经设法安装了柴油客户端和 postgres 驱动程序(我可以在同一台笔记本电脑上使用 sqlalchemy 连接到 postgres)。但是,每当我尝试运行 rust 柴油客户端时,我都会收到以下错误:
dyld: lazy symbol binding failed: Symbol not found: _PQconnectdb
Referenced from: /Users/maxwellflitton/.cargo/bin/diesel
Expected in: flat namespace
dyld: Symbol not found: _PQconnectdb
Referenced from: /Users/maxwellflitton/.cargo/bin/diesel
Expected in: flat namespace
zsh: abort
我在配置文件中有以下配置,/Users/maxwellflitton/.cargo/config其中包含以下内容:
[target.x86_64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]
[target.aarch64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]
我有以下配置:
- Rust: rustc 1.51.0 (2fd73fabe 2021-03-23)
- 柴油机:
{ version = "1.4.4", features = ["postgres"] } - 数据库: postgres
- 操作系统: MacOs Big Sur 11.2.3 M1芯片