我一直在尝试在我的 Macbook M1 上运行 Rust Diesel crate,但它不起作用。编译的最后部分因以下错误而中断:
\n = note: ld: warning: ignoring file /usr/local/Cellar/libpq/14.1/lib/libpq.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64\n Undefined symbols for architecture arm64:\nRun Code Online (Sandbox Code Playgroud)\n当我得到信息时,libpq我得到以下信息:
maxwellflitton@Maxwells-MacBook-Pro vanguard % brew info libpq \nlibpq: stable 14.1 (bottled) [keg-only]\nPostgres C API library\nhttps://www.postgresql.org/docs/14/libpq.html\n/usr/local/Cellar/libpq/14.1 (2,335 files, 27.8MB)\n Poured from bottle on 2022-01-09 at 00:14:32\nFrom: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libpq.rb\nLicense: PostgreSQL\n==> Dependencies\nRequired: krb5 \xe2\x9c\x94, openssl@1.1 \xe2\x9c\x94\n==> Caveats\nlibpq is keg-only, which means it was not symlinked into /usr/local,\nbecause conflicts …Run Code Online (Sandbox Code Playgroud) 我正在关注柴油指南:LINK
当我尝试这个时:
cargo install diesel_cli --no-default-features --features postgres
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
error: failed to compile `diesel_cli v1.4.1`, intermediate artifacts can be found at
Run Code Online (Sandbox Code Playgroud)
和一个注释:
= note: ld: library not found for -lpq
Run Code Online (Sandbox Code Playgroud)