问题
I am having problem in pushing my master branch to heroku. I am using the following command:
git push heroku master
Error that I am encountering-
Counting objects: 114, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (112/112), done.
Writing objects: 100% (114/114), 335.40 KiB | 0 bytes/s, done.
Total 114 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Failed to detect set buildpack https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/php.tgz
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to skyconfapp.
remote:
To https://git.heroku.com/skyconfapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/skyconfapp.git'
I even visited Heroku's link https://devcenter.heroku.com/articles/buildpacks#detection-failure and tried to implement every method that they have mentioned but nothing seems to be working for me.
Can someone please assist?
回答1:
Just happened to me and then I got this working
Try clearing the buildpacks, adding it again and add/commit/push to heroku
heroku buildpacks:clear
heroku buildpacks:set heroku/php
git add/commit/push heroku master
回答2:
I got the same issue, but i fixed by adding "requirements.txt" in the root directory as mentioned here
The Heroku Support will be applied to applications only when the application has a requirements.txt or Pipfile in the root directory. Even if an application has no module dependencies, it should include an empty requirements.txt or Pipfile to document that your app has no dependencies.
回答3:
If you are trying to push a nodejs app and you are getting this error, this could be because you are not specifying node version. I was having this error and it was being caused because I was not specifying "engines": { "node: "8.2.1" }
You can have more details here: https://kb.heroku.com/why-is-my-node-js-build-failing-because-of-an-invalid-semver-requirement
回答4:
Late answer. Perhaps it can be helpful for a few.
That happened to me when I was pushing a python app. It can be caused if there's an error in naming some file. In my case, it's python and I had misspelled a file name. So, it was unable to detect the build pack. Renaming the file should work I guess.
回答5:
One cannot push random repos to Heroku without configuring some things in the app's root. For instance, if you want to make a Python app you should include a requirements.txt or setup.py file to your app's root. With this, Heroku can decide what kind of assests it needs and configure itself. And you can push successully from here.
The problem is mostly caused by a un-collectable dependency lib; check your requirements.
回答6:
This happened to me when my Node.js app did not follow the buildpack requirements. I had the package.json file in a /server subdirectory, but it needed to be at the root directory. Once I moved all my server files into the root directory, heroku was able to determine the correct buildpack and I was able to push to my heroku app.
回答7:
Sometimes this is caused because when you create your frontend application, it also initialize git automatically.
First, you have to delte .git folder inside you clientFolder folder
Then, run the next code to delete the git submodule cache
git rm -f --cached clientFolder
Then just make an add and a commit to your repository
git add .
git commit -am 'Adding clientFolder to the main git repository'
Now you can run:
git push heroku master
Hope this would help someone.
回答8:
I encountered this issue in Rails when I failed to run bundle install after removing a meaningless gem from my Gemfile. Consequently, Gemfile.lock was mismatched, and Heroku rejected the push.
来源:https://stackoverflow.com/questions/39267808/heroku-push-gets-rejected