git 推送被拒绝,未检测到支持 Cedar 的应用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18358858/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Push rejected, no Cedar-supported app detected
提问by Venkateshwaran Selvaraj
I know this question has been asked several times. But I couldnot stop myself to post this here. I am nooby. I am trying to push the app from git to heroku using the following command
我知道这个问题已经被问过好几次了。但我无法阻止自己在这里发帖。我是菜鸟。我正在尝试使用以下命令将应用程序从 git 推送到 heroku
ubuntu@ip-1x2-xx-xx-xxx:~/vexxx$ git push heroku master
I am getting the following error.
我收到以下错误。
Counting objects: 8, done.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (8/8), 1015 bytes, done.
Total 8 (delta 0), reused 0 (delta 0)
! Push rejected, no Cedar-supported app detected
To [email protected]:fast-fortress-3889.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:fast-fortress-3889.git'
I am trying to use node.js framework
我正在尝试使用 node.js 框架
UPDATE
更新
I have two files in my app folder name vxxxx/
我的应用程序文件夹中有两个文件,名称为 vxxxx/
1.README.md
1.README.md
2.venkat1.js
2.venkat1.js
Inside venkat1.js
venkat1.js 内部
#!/usr/bin/env node
var fs = require('fs');
var outfile = "hello.txt";
var out = "A startup is a business built to grow rapidly.\n";
fs.writeFileSync(outfile, out);
console.log("Script: " + __filename + "\nWrote: " + out + "To: " + outfile);
I do not have any other files. Actually these two files are in my git repo. I am trying to push it to heroku and run the app there using node.js
我没有任何其他文件。实际上这两个文件在我的 git repo 中。我正在尝试将它推送到 heroku 并使用 node.js 在那里运行应用程序
Update 2:
更新 2:
Yes. I do have a package.JSON file
是的。我有一个 package.JSON 文件
{
"name": "vxxxxx",
"version": "0.0.2",
"description": "a sample node.js app for heroku",
"main": "venkat1.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"express": "~3.3.4"
},
"engines": {
"node": "0.10.13",
"npm": "1.3.2"
},
"repository": {
"type": "git",
"url": "https://github.com/Mygitusername/myreponame"
},
"keywords": [
"node",
"heroku"
],
"author": "Venkateshwaran",
"license": "MIT",
}
and a Procfile too.
还有一个Procfile。
web: node venkat1.js
采纳答案by Venkateshwaran Selvaraj
I am answering my own question .
我正在回答我自己的问题。
Actually the problem was that I did not include node_modules
其实问题是我没有包括 node_modules
so I used
所以我用
$ npm install
After that it had no problem pushing into heroku. Thanks everyone for helping me.
之后,推入heroku就没有问题了。谢谢大家帮助我。
回答by Mike
Heroku will detect a supported app by looking for specific files in your project. Heroku describes these "triggers" here:
Heroku 将通过查找项目中的特定文件来检测受支持的应用程序。Heroku 在这里描述了这些“触发器”:
回答by AndyZhuang
I encounter the same problem while pushing my rails project to heroku.
我在将 Rails 项目推送到 heroku 时遇到了同样的问题。
until I tried to use the following command to create in heroku, then succeed!!! You should try this as well.
直到我尝试使用以下命令在heroku中创建,然后成功!!!你也应该试试这个。
"heroku create --stack cedar"
“heroku 创建 --stack cedar”