我无法找出是什么给了我错误。我无法将代码推送到heroku。我一步一步地跟踪了一个在线课程,但是我身边的一些事情导致了拒绝。我尝试从头开始一切,但没有运气。我不断遇到同样的问题。
GIT中:
> git push heroku master
Counting objects: 14, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (14/14), 1.42 KiB | 0 bytes/s, done.
Total 14 (delta 1), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-2.7.12
remote: $ pip install -r requirements.txt
remote: Collecting click==6.6 (from -r requirements.txt (line 1))
remote: Downloading click-6.6.tar.gz (283kB)
remote: Collecting Flask==0.11.1 (from -r requirements.txt (line 2))
remote: Downloading Flask-0.11.1-py2.py3-none-any.whl (80kB)
remote: Collecting gunicorn==19.6.0 (from -r requirements.txt (line 3))
remote: Downloading gunicorn-19.6.0-py2.py3-none-any.whl (114kB)
remote: Collecting itsdangerous==0.24 (from -r requirements.txt (line 4))
remote: Downloading itsdangerous-0.24.tar.gz (46kB)
remote: Collecting Jinja2==2.8 (from -r requirements.txt (line 5))
remote: Downloading Jinja2-2.8-py2.py3-none-any.whl (263kB)
remote: Collecting MarkupSafe==0.23 (from -r requirements.txt (line 6))
remote: Downloading MarkupSafe-0.23.tar.gz
remote: Collecting Werkzeug==0.11.10 (from -r requirements.txt (line 7))
remote: Downloading Werkzeug-0.11.10-py2.py3-none-any.whl (306kB)
remote: Installing collected packages: click, itsdangerous, Werkzeug, MarkupSafe, Jinja2, Flask, gunicorn
remote: Running setup.py install for click: started
remote: Running setup.py install for click: finished with status 'done'
remote: Running setup.py install for itsdangerous: started
remote: Running setup.py install for itsdangerous: finished with status 'done'
remote: Running setup.py install for MarkupSafe: started
remote: Running setup.py install for MarkupSafe: finished with status 'done'
remote: Successfully installed Flask-0.11.1 Jinja2-2.8 MarkupSafe-0.23 Werkzeug-0.11.10 click-6.6 gunicorn-19.6.0 itsdangerous-0.24
remote:
remote: Traceback (most recent call last):
remote: File "/app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/vendor/pip-pop/pip-grep", line 81, in <module>
remote: main()
remote: File "/app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/vendor/pip-pop/pip-grep", line 76, in main
remote: grep(**kwargs)
remote: File "/app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/vendor/pip-pop/pip-grep", line 45, in grep
remote: r = Requirements(reqfile)
remote: File "/app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/vendor/pip-pop/pip-grep", line 25, in __init__
remote: self.load(reqfile)
remote: File "/app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/vendor/pip-pop/pip-grep", line 36, in load
remote: for requirement in parse_requirements(reqfile, finder=finder, session=requests):
remote: File "/app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/vendor/pip-pop/pip/req/req_file.py", line 89, in parse_requirements
remote: for req in req_iter:
remote: File "/app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/vendor/pip-pop/pip/req/req_file.py", line 137, in process_line
remote: isolated=isolated, options=req_options, wheel_cache=wheel_cache
remote: File "/app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/vendor/pip-pop/pip/req/req_install.py", line 168, in from_line
remote: if (os.path.isdir(p) and
remote: File "/app/.heroku/python/lib/python2.7/genericpath.py", line 49, in isdir
remote: st = os.stat(s)
remote: TypeError: stat() argument 1 must be encoded string without null bytes, not str
remote: -----> Discovering process types
remote:
remote: ! Push failed: cannot parse Procfile.
remote: ! Please try pushing again.
remote: ! If the problem persists, see http://help.heroku.com/ and provide Request ID 9da9f85c-09e1-40e9-b8fe-a09eff718783.
remote:
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to warm-ocean-27938.
remote:
To https://git.heroku.com/warm-ocean-27938.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/warm-ocean-27938.git'
的.git /配置:
. . .
[remote "heroku"]
url = https://git.heroku.com/warm-ocean-27938.git
fetch = +refs/heads/*:refs/remotes/heroku/*
这是导致错误的 Procfile 。我不确定为什么它不能正常工作,因为我一步一步地按照教程。这就是我在那里:
web: gunicorn routes:app
我编辑 Procfile 以删除冒号后的空格:
web:gunicorn routes:app
然后我跑了:
heroku create
之后,我把它推到了heroku并收到了这个有点不同的错误:
>git push heroku master
. . .
remote: Successfully installed Flask-0.11.1 Jinja2-2.8 MarkupSafe-0.23 Werkzeug-0.11.10 click-6.6 gunicorn-19.6.0 itsdangerous-0.24
remote:
remote: Traceback (most recent call last):
remote: File "/app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/vendor/pip-pop/pip-grep", line 81, in <module>
remote: main()
remote: File "/app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/vendor/pip-pop/pip-grep", line 76, in main
remote: grep(**kwargs)
remote: File "/app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/vendor/pip-pop/pip-grep", line 45, in grep
remote: r = Requirements(reqfile)
remote: File "/app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/vendor/pip-pop/pip-grep", line 25, in __init__
remote: self.load(reqfile)
remote: File "/app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/vendor/pip-pop/pip-grep", line 36, in load
remote: for requirement in parse_requirements(reqfile, finder=finder, session=requests):
remote: File "/app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/vendor/pip-pop/pip/req/req_file.py", line 89, in parse_requirements
remote: for req in req_iter:
remote: File "/app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/vendor/pip-pop/pip/req/req_file.py", line 137, in process_line
remote: isolated=isolated, options=req_options, wheel_cache=wheel_cache
remote: File "/app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/vendor/pip-pop/pip/req/req_install.py", line 168, in from_line
remote: if (os.path.isdir(p) and
remote: File "/app/.heroku/python/lib/python2.7/genericpath.py", line 49, in isdir
remote: st = os.stat(s)
remote: TypeError: stat() argument 1 must be encoded string without null bytes, not str
remote: -----> Discovering process types
remote:
remote: -----> Compressing...
remote: Done: 37.2M
remote: -----> Launching...
remote: Released v3
remote: https://warm-ocean-27938.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/warm-ocean-27938.git
* [new branch] master -> master
在我的项目文件夹中:
C:\Users\combatmath\apps\ocrbox [master ↑ +1 ~1 -0 | +0 ~4 -0 !]> ls -R
Directory: C:\Users\combatmath\apps\ocrbox
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 8/6/2016 3:15 PM .idea
d----- 8/6/2016 3:04 AM ocrbox
d----- 8/5/2016 8:20 PM static
d----- 8/6/2016 3:14 PM templates
-a---- 8/6/2016 3:16 AM 24 .gitignore
-a---- 8/6/2016 2:16 PM 24 Procfile
-a---- 8/5/2016 8:21 PM 0 README.md
-a---- 8/6/2016 3:32 AM 232 requirements.txt
-a---- 8/6/2016 3:04 PM 275 routes.py
Directory: C:\Users\combatmath\apps\ocrbox\.idea
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 8/5/2016 5:59 AM 7 .name
-a---- 8/5/2016 5:56 AM 706 misc.xml
-a---- 8/5/2016 9:31 PM 288 modules.xml
-a---- 8/5/2016 9:31 PM 663 ocrbox.iml
-a---- 8/6/2016 3:00 PM 180 vcs.xml
-a---- 8/6/2016 3:15 PM 29636 workspace.xml
Directory: C:\Users\combatmath\apps\ocrbox\ocrbox
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 8/6/2016 3:04 AM 395 .gitattributes
-a---- 8/6/2016 3:04 AM 696 .gitignore
Directory: C:\Users\combatmath\apps\ocrbox\static
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 8/6/2016 2:49 AM css
d----- 8/5/2016 8:20 PM img
d----- 8/5/2016 8:20 PM js
Directory: C:\Users\combatmath\apps\ocrbox\static\css
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 8/6/2016 2:49 AM 26 main.css
Directory: C:\Users\combatmath\apps\ocrbox\templates
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 8/6/2016 3:14 PM 133 about.html
-a---- 8/6/2016 3:13 PM 277 base.html
-a---- 8/5/2016 9:48 PM 6 header.html
-a---- 8/6/2016 3:14 PM 293 index.html