我在 Terraform 中遇到錯誤:
錯誤:補丁“https://api.heroku.com/apps/coderdojo-contentful-staging/formation/web”:找不到該行程型別(網路)。
│
│ 使用 heroku_formation.coderdojo_contentful_staging_formation[0],
│ 在 terraform.tf 第 41 行,在資源“heroku_formation”“coderdojo_contentful_staging_formation”中:│41
:資源“heroku_formation”“coderdojo_contentful_staging_formation”{
從我的terraform.tf檔案中的這些行:
resource "heroku_formation" "coderdojo_contentful_staging_formation" {
count = length(var.formations)
app = heroku_app.coderdojo_contentful_staging.name
type = lookup(var.formations[count.index], "type")
quantity = lookup(var.formations[count.index], "quantity")
size = lookup(var.formations[count.index], "size")
}
這依賴于我terraform.tfvars檔案中的這些行:
formations = [
{
type = "web"
size = "standard-1x"
quantity = "1"
}
]
buildpacks = [
"heroku/ruby"
]
在線搜索檔案(例如buildpacks和heroku-buildpack-ruby)似乎 web 行程型別來自 buildpack 或Procfile.
另一個專案使用非常相似的設定(即 no Procfile)運行良好,但添加了一個heroku/nodejsbuildpack。我嘗試添加該構建包,但得到了同樣的錯誤。
我錯過了什么?
uj5u.com熱心網友回復:
另一個專案使用非常相似的設定(即 no
Procfile)運行良好,但添加了一個heroku/nodejsbuildpack。我嘗試添加該構建包,但得到了同樣的錯誤。
heroku/nodejsbuildpack 回退到在package.jsonif noProcfile存在時定義的啟動腳本。我懷疑您使用該 buildpack 的其他專案有一個啟動腳本。Ruby buildpack沒有這樣的默認值。
如果您的應用不需要 Node.js,請不要添加 Node.js 構建包。相反,添加一個Procfile到你的存盤庫的根目錄,告訴 Heroku 如何運行你的應用程式,例如
web: bundle exec ruby path/to/some/script.rb
這定義了一個web運行的行程bundle exec ruby ruby path/to/some/script.rb。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/428146.html
下一篇:Webpacker在/app/public/packs/manifest.json中找不到application.js,洗掉node_modules檔案夾后我無法預編譯資產
