'无法找到该进程类型'heroku节点部署

问题描述 投票:5回答:2

当我尝试做$ heroku ps:scale web=1时,我得到'找不到那个过程类型'。我看了一些其他解决方案,建议确保我的Procfile正确拼写并正确推送,这是。

这是我得到的确切错误:

    heroku ps:scale web=1
Scaling dynos... !
 ▸    Couldn't find that process type.
Error: ENOENT: no such file or directory, open '/Users/XXXXXX/.cache/heroku/error.log'
    at Object.fs.openSync (fs.js:584:18)
    at Object.fs.writeFileSync (fs.js:1316:33)
    at Object.fs.appendFileSync (fs.js:1362:6)
    at log (/usr/local/Cellar/heroku/6.6.7/libexec/node_modules/heroku-cli-util/lib/errors.js:87:6)
    at handleErr (/usr/local/Cellar/heroku/6.6.7/libexec/node_modules/heroku-cli-util/lib/errors.js:102:9)
    at process._tickCallback (internal/process/next_tick.js:109:7)
node.js heroku deployment
2个回答
9
投票

我发现问题是什么,在我的项目中,我没有推动到主分支,我正在执行错误的git代码。因此,如果您正在使用不同的分支,则推送到Heroku的正确方法如下:

git push heroku <branch_name>:master

1
投票

虽然以下答案适用于Rails,但它当然适用于任何框架。

应用程序部署日志应列出这些默认类型:

Default types for buildpack -> console, rake, web, worker

(运行git push时会显示此日志,您也可以在Heroku仪表板的活动源中找到它们)

如果此行(或类似的东西)不存在,这可能是由于您的应用程序的构建包。您可以列出以下内容:

$ heroku buildpacks --app myapp
=== myapp Buildpack URLs
1. heroku/ruby
2. https://github.com/some/buildpack.git

在这个例子中,heroku/ruby排在第一位,这可能听起来合法。但似乎最后一个buildpack取消了heroku/ruby创建的类型。要解决此问题,请确保此buildpack最后一次。你可以用buildpacks:removebuildpacks:add --index实现这个目的:

$ heroku buildpacks:remove https://github.com/some/buildpack.git --app myapp
$ heroku buildpacks:add --index 1 https://github.com/some/buildpack.git --app myapp
$ heroku buildpacks --app myapp
=== myapp Buildpack URLs
1. https://github.com/some/buildpack.git
2. heroku/ruby

使用git push再次部署应用程序,现在可以启动webworker进程。

© www.soinside.com 2019 - 2024. All rights reserved.