git push heroku master: Heroku push rejected, no Cedar-supported app detected

前端 未结 12 880
执笔经年
执笔经年 2020-12-14 10:00

I tried running:

$ git push heroku master    
-----

Total 7121 (delta 2300), reused 6879 (delta 2228)
 !     Heroku push rejected, no Cedar-supported app de         


        
相关标签:
12条回答
  • 2020-12-14 10:27
    rm -rf .git
    git init 
    git add .
    git commit -m "First commit"
    heroku create --stack cedar
    git push heroku master
    

    This worked for me as well !

    0 讨论(0)
  • 2020-12-14 10:32

    Just had this problem too. I did the following to solve it: (assuming you're in project dir)

    rm -rf .git
    git init 
    git add .
    git commit -m "First commit"
    heroku create --stack cedar
    git push heroku master
    

    A slightly involved solution to create a new application, but at least it works. Hope that helps!

    0 讨论(0)
  • 2020-12-14 10:36

    For everyone deleting their Git history to make this work... the only reason that works is because the initial commit in the new repository contains the necessary files for Heroku to recognize your app.

    I ran into this problem because I added the Procfile and requirements.txt for my app and tried to push to Heroku before actually committing them. So when I pushed to Heroku, I wasn't pushing those files!

    Making a commit with all the necessary files and then pushing should solve this problem, and is vastly preferable to deleting your entire Git history.

    Hope this helps!

    0 讨论(0)
  • 2020-12-14 10:37

    You probably need to add a requirements.txt file. check the python app docs

    0 讨论(0)
  • 2020-12-14 10:38

    I had a similar issue and in my case was because my apps were outside of my project folder. Heroku expects to have this structure:

    Procfile
    requirements.txt
    static/
    myproject/
      manage.py
      app1/
      app2/
      ..
    
    0 讨论(0)
  • 2020-12-14 10:42

    Heroku needs a requirements.txt file, which helps Heroku know what dependencies need to be installed for your Django project. You can use a tool generate your requirements.txt file.

    Run in command line

    pip freeze > requirements.txt

    which will create a requirements.txt file with all your installed packages, such as Django, django-registration, etc...

    This link may be helpful: http://tutorial.djangogirls.org/deploy/README.html

    0 讨论(0)
提交回复
热议问题