Hello, I want to deploy my Ktor App to Heroku. The deployment says “Build successful” but when I sta...
n
Hello, I want to deploy my Ktor App to Heroku. The deployment says “Build successful” but when I start the app, I get application error. Now I saw that I don’t have a .build/install directory in my build folder. This direcotry is referenced in the .Procfile as direction for heroku where to start the app. So how can I create this install directory? Thanks a lot!
r
Are you following this: https://ktor.io/docs/heroku.html?
v
Seeing from your screenshot that you are using Gradle and assuming you are using the
application
plugin, you would call the
installDist
task, or rather depend on it from the
stage
task that Heroku is calling.
r
The critical bit will be adding this to `build.gradle.kts`:
Copy code
tasks {
    create("stage").dependsOn("installDist")
}
Heroku will check out your code and run
gradle stage
when you push to heroku, and that will create the build/.build/install
build/install
directory on Heroku's side. You should not commit
build
or anything in it to source control.
v
build/install/
actually And you should never use
tasks.create
but always
tasks.register
due to task configuration avoidance, those instructions are simply bad.
r
D'oh, yes, missed that it was running a command...
n
Okay I will try thank you guys!