问题
I am trying to deploy a test app to Heroku --stack cedar but every time I do my Procfile is being ignored.
It should be saying this:
Procfile declares types -> web
But says this
Procfile declares types -> (none)
Because of this problem it of course won't load on the heroku platform when I navigate the URL.
Aside from this test (A) I have an IDENTICAL project (B) in another folder which DOES work. I am so utterly confused as to why (A) doesn't that I'm coming here to ask now.
A couple other things I've tried with (A) include:
- recreating the heroku app
- recreating the git repo (i.e. delete .git, git init...)
- clearing out the files from the project folder, and copying the files from the other copy that works
If I make top-level folder copy of (B) then that copy will work. The issue seems to be copying files/folders from within (B) et al to within (A), the cursed one.
So, so far all I can determine is everything is working minus this (A) cursed folder. I would love to find out why instead of having to come to a witch-craft conclusion.
回答1:
I had the same problem and I just now I found what was wrong. I first accidently called the file ProcFile instead of Procfile. Simply renaming that file did not get picked up by git. I had to do a git rm ProcFile -f first and then add a new (correctly named) Procfile. After that, it got pushed correctly by git and got picked up correctly by Heroku.
回答2:
The space between the Record name and the contents seems to be important:
Use:
web: python manage.py runserver
and not
web:python manage.py runserver
回答3:
Make sure your Procfile does not have any extension.And if it has any you have to rename that file to Procfile without any extension and commit and check out the master
回答4:
Did you remember to commit your Procfile to git? I've forgotten to do this commit, done a git push heroku master, and seen the (none) message stated above.
If you've forgotten, then commit your Procfile and perform git push heroku master again.
回答5:
I'm adding to Pascal Lindelauf answer - make sure your file name is "Procfile" (with a capital P) and not "procfile" (that was the case with me just now) good luck!
回答6:
I have sth to say about "Procfile declares types -> (none)" error.
One thing we should pay attention to is the hidden extension of "Procfile" file. I thought my command in "Procfile" was correct but I kept receiving this error. After half an hour I found that "Procfile" has the extension ".txt" but was hidden by the default setting of my macOS. After removing the extension, everything works fine!
来源:https://stackoverflow.com/questions/6346221/what-is-the-reason-for-procfile-declares-types-none-in-heroku