Heroku部署-推送被拒绝,未检测到Cedar支持的应用程序
Heroku deploying - Push rejected, no Cedar-supported app detected
我正试图在heroku服务器上部署我的3d游戏(使用three.js创建)。但是在一个命令"gitpushheroku大师"后,我得到了以下问题:
Initializing repository, done.
Counting objects: 252, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (251/251), done.
Writing objects: 100% (252/252), 2.38 MiB | 89.00 KiB/s, done.
Total 252 (delta 55), reused 0 (delta 0)
-----> Removing .DS_Store files
! Push rejected, no Cedar-supported app detected
To git@heroku.com:infinite-woodland-7676.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:infinite-woodland-7676.git'
链接到存储库-->https://github.com/mkkroliks/Snake3d
我没有使用heroku的经验,所以这可能是一个简单的解决方案,但我在网上找不到。
您需要添加一个描述如何运行应用程序的Procfile
或一个描述依赖关系的package.json
文件,以便Heroku可以确定这是什么类型的应用程序并相应地编译它。
类似于:
- https://devcenter.heroku.com/articles/getting-started-with-nodejs#define-a-procfile
或
- https://devcenter.heroku.com/articles/getting-started-with-nodejs#declare-应用程序依赖项
根据我的经验,有四个潜在的问题。
首先,您需要确保您拥有能够执行脚本的Procfile。它应该包含这样的内容:
节点服务器.js
其次,您需要确保您的package.json
具有与npm
开始键一起列出的所有必要的依赖项。要确保加载了所有依赖项,请删除node_modules文件夹,运行"npm install --production"
,然后尝试运行应用程序。如果您缺少任何依赖项,您将得到一个缺少的模块错误。
第三,确保您的应用程序在heroku's
环境中工作。在Procfile
目录中的命令行中运行"foreman start web",然后在localhost:5000.
上查看您的站点
第四个可能的错误源(也是我遇到的错误)是所有这些文件(Procfile and package.json
)都需要在git根目录中。即使这些文件不在根目录中,Foreman也可以运行,所以只需仔细检查即可。
相关文章:
- 如何检测是否有溢出
- 如何检测用于WebGL的专用或集成显卡
- 防止Alt+Shift默认操作或检测多种操作系统语言的Javascript
- 如何在使用selectBoxIt JQuery插件时检测选项更改
- 如何使用密码检测网络中的状态连接
- 使用JavaScript检测Flash
- 在不阻止默认行为的情况下检测IE10中的缩放
- 检测个位数整数时正在转换毫秒
- 检测电话窃听,即:<a href="电话:xxx">在UIWebview上
- 动态插入的表:JQuery未检测到最后一行
- 检测页面上某个元素中选择(突出显示)或单击的内容
- jQuery检测浏览器是否支持Zoom
- 检测iframe是否跨域的愚蠢方法
- 检测图像分辨率
- 如何检测第三方广告服务器请求
- 我是否可以检测到javascript正在被卸载(作为调试模式)
- 当没有文本输入聚焦时检测空格键按下
- 正在检测导航到<a name=“;最新主题”></a>
- 如何检测重叠元素下的单击
- Heroku部署-推送被拒绝,未检测到Cedar支持的应用程序