为什么我的luminus应用程序无法在Heroku上运行?



我是一个完全的初学者,并遵循这本书:https://pragprog.com/titles/dswdcloj3/web-development-with-clojure-third-edition/

我遵循了书中关于部署到Heroku的说明:https://luminusweb.com/docs/deployment.html#heroku_deployment但是我遇到了一些问题。

这是我的问题和我采取的步骤。我使用的源代码,从留言簿控制器在这里修改它,只是想让应用程序在Heroku工作(即能够使帐户,登录和发布消息)。这是我的repo: https://github.com/johnbradens/guestbook-heroku

下面是我的步骤:

git init
git add .
git commit -m "initial commit"
I added a bin/build file and ran chmod u+x bin/build (based on instructions from https://folcon.github.io/post/2020-04-12-Fulcro-on-Heroku/, because it was saying that react wasn't installed)
I added heroku buildpacks nodejs & clojure (otherwise it said it couldn't read the npm from bin/build)
heroku addons:create heroku-postgresql
git push heroku main

这是我在Heroku应用程序中看到的:

错误1错误2

当我运行heroku run lein run migrate时,我得到以下错误:

Syntax error compiling at (/tmp/form-init6415984187052473661.clj:1:73).
could not find a non empty configuration file to load. looked in the classpath (as a "resource") and on a file system via "conf" system property

我试着编辑env/prod/resources/config.edn,但我不知道该怎么做。我试了很多方法,但都没用。

这是我尝试的一个例子,在改变env/prod/resources/config.edn文件。上面的一个链接说只有{:prod true},所以这就是我现在拥有的,但我也尝试过:

{:prod true
:port (System/getenv "PORT")
:database-url (System/getenv "JDBC_DATABASE_URL")
}
编辑:我发现多亏了clojure slack,我的env文件夹被忽略了,并创建了一个prod-config。在这个文件中我有上面的文本。我试着再次推到Heroku,我仍然得到与web应用程序上的图像相同的错误,当我运行heroku run lein run migrate配置文件未被找到时,我仍然得到相同的错误信息。

我该怎么办?

好了,各位,这就是最终解决它的方法。我在这个github帖子中发现了这个:https://github.com/luminus-framework/luminus/issues/231

似乎

heroku run lein run migrate

文档中的不起作用。

迁移可以运行生成的jar文件:

heroku run java -cp target/uberjar/<app name>.jar clojure.main -m guestbook.core migrate

把这个留在这里,以防其他人有同样的问题。