使用scala示例在本地运行heroku时出错

使用scala示例在本地运行heroku时出错,scala,heroku,Scala,Heroku,下面是使用scala对heroku的介绍。在我应该在本地运行应用程序的一品脱,我得到了以下错误 PS E:\heroku_test\scala-getting-started> heroku local web -f Procfile.windows forego | starting web.1 on port 5000 web.1 | [warn] application - Logger configuration in conf files is deprecated and h

下面是使用scala对heroku的介绍。在我应该在本地运行应用程序的一品脱,我得到了以下错误

PS E:\heroku_test\scala-getting-started> heroku local web -f Procfile.windows
forego | starting web.1 on port 5000
web.1  | [warn] application - Logger configuration in conf files is deprecated and has no effect. Use a logback configur
ation file instead.
web.1  | [info] application - Creating Pool for datasource 'default'
web.1  | [error] c.z.h.HikariConfig - when specifying driverClassName, jdbcUrl must also be specified
web.1  | Oops, cannot start the server.








web.1  | Configuration error: Configuration error[Cannot connect to database [default]]
web.1  | Factory.java:62)
web.1  | stMethod.java:53)
web.1  | at com.google.inject.Guice.createInjector(Guice.java:96)
web.1  | a:199)
我怀疑这很简单,但我在谷歌上找不到错误信息。此外,本教程中前面的所有步骤都完全按照预期进行

编辑: 从application.conf

# Database configuration
# ~~~~~
# You can declare as many datasources as you want.
# By convention, the default datasource is named `default`
#
# db.default.driver=org.h2.Driver
# db.default.url="jdbc:h2:mem:play"
# db.default.user=sa
# db.default.password=""

db.default.driver=org.postgresql.Driver
db.default.url=${?DATABASE_URL}
Procfile.windows

web: target\universal\stage\bin\play-getting-started.bat

您的环境中缺少数据库URL。您可以看到这个家伙db.default.url=${?DATABASE_url}正在尝试使用它

因此,在启动activator run或运行heroku local web-f Procfile.windows或其他启动本地服务器的工具之前,您需要设置一个指向要使用的Postgres的链接

这适用于quick local hack首先在本地安装Postgres,它要求您设置Postgres用户的密码:

set DATABASE_URL=postgres://postgres:<PASSWORD>@localhost:5432/<DB_NAME>
,其中是您在安装时设置的数据库,以及您希望在Postgres中使用的数据库的名称。请在那里使用psql创建一个数据库

在此之后,服务器将运行。

能否在conf/application.conf文件中发布db.default条目?你能发布Procfile.windows的内容吗?