【问题标题】:Rust, Windows 10: Diesel doesn't work, diesel setup provides no outputRust,Windows 10:柴油机不工作,柴油机设置不提供输出
【发布时间】:2021-07-25 06:19:16
【问题描述】:

我是 Rust 的新手,我想尝试 Diesel 和 Postgres。我已按照此处描述的步骤进行操作:

https://diesel.rs/guides/getting-started

但不幸的是,当涉及到 diesel setup 时,什么也没有发生。我没有收到任何输出,没有错误消息,什么也没有。我已经使用命令install diesel_cli --no-default-features --features postgres 安装了diesel_cli,我在Windows 10 上安装了Postgres 13。

这是我的 .env 文件中的内容:DATABASE_URL=postgres://postgres:pwd@localhost:5432/diesel(密码是 pwd)。我创建了一个名为“diesel”的数据库,它在 Postgres 服务器上运行,具有默认设置。它目前是空的,没有表格。

我没有收到来自diesel setupdiesel migrate generate create_posts 的输出。甚至没有错误消息。

其他人是否也遇到过这个问题?知道是什么原因造成的吗?

【问题讨论】:

  • 你说得对,我已经编辑了文本!

标签: windows postgresql rust orm


【解决方案1】:

如果你在 windows 中使用 powershell,它不会给出错误信息。 在 powershell 上 echo $LASTEXITCODE 会给出错误代码。

get lastexitcode

使用命令行会给出错误信息。

我将此“C:\Program Files\PostgreSQL\13\bin”添加到我的路径环境变量中。

现在柴油设置和其他 cli 命令正在运行。

Reference

【讨论】:

    猜你喜欢
    • 2021-09-26
    • 2020-11-07
    • 1970-01-01
    • 2022-12-10
    • 2020-05-09
    • 2021-03-17
    • 2021-03-10
    • 2021-07-06
    • 2022-12-10
    相关资源
    最近更新 更多