jos*_*jan 3 rust rust-cargo rust-diesel
我正在关注柴油指南: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)
解决方案:
\n问题是货物无法找到 pq 库,所以我需要使用:
\n sudo apt install libpq-dev\nRun Code Online (Sandbox Code Playgroud)\n这也给我发送了一个错误:
\nThe operation couldn\xe2\x80\x99t be completed. Unable to locate a Java Runtime that supports apt.\nPlease visit http://www.java.com for information on installing Java.\nRun Code Online (Sandbox Code Playgroud)\n首先\n我需要检查环境变量,检查你的文件:
\n% open -e .bash_profile\nRun Code Online (Sandbox Code Playgroud)\n文件内容:
\nexport JAVA_HOME=$(/usr/libexec/java_home)\nRun Code Online (Sandbox Code Playgroud)\n但错误仍然存在......所以这对我没有帮助。我想有时只需要这个,在我的例子中,我用brew来安装这些元素。
\n第二:\n安装 postgreql
\nbrew install postgresql\nRun Code Online (Sandbox Code Playgroud)\n第三:安装libpq
\nbrew install libpq \nRun Code Online (Sandbox Code Playgroud)\n最后:安装diesel CLI
\ncargo install diesel_cli --no-default-features --features postgres\nRun Code Online (Sandbox Code Playgroud)\n
| 归档时间: |
|
| 查看次数: |
2613 次 |
| 最近记录: |