/app/.heroku/python/bin/python: /app/.heroku/python/bin/python: 无法执行二进制文件
当我尝试
heroku run bash python manage.py migrate --app appName
使用 Heroku CLI 从终端运行时,出现以下错误/响应;
/app/.heroku/python/bin/python: /app/.heroku/python/bin/python: cannot execute binary file
-- 使用屏幕截图更新 --
即使当我尝试 heroku run python manage.py migrate --app appName
而不添加 bash 时,我仍然收到错误。
When I tried running
heroku run bash python manage.py migrate --app appName
from my terminal using the Heroku CLI, I get below error/response;
/app/.heroku/python/bin/python: /app/.heroku/python/bin/python: cannot execute binary file
-- Updated with screenshot --
Even when I tried heroku run python manage.py migrate --app appName
without adding bash, I still get an error.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个命令没有意义:
让我们分解一下:
heroku run ... --app appName
告诉 Heroku 在应用程序上运行...
中的内容 < code>appNamepython manage.py migrate
是您要在 dyno 上运行的命令:python
是可执行文件manage.py
是Python执行的文件migrate
是传递给manage.py
的参数
事实上,你告诉 Heroku 运行
bash python manage.py migrate
,你在其中运行bash
并将其传递给python manage.py migrate
作为论据。由于python
不是shell脚本,因此bash
无法执行它。失去
bash
:This command doesn't make sense:
Let's break it down:
heroku run ... --app appName
tells Heroku to run the stuff in...
on the appappName
python manage.py migrate
is the command you want to run on your dyno:python
is the executablemanage.py
is the file Python executesmigrate
is an argument passed tomanage.py
bash
... doesn't do anything useful hereIn fact, you are telling Heroku to run
bash python manage.py migrate
, where you runbash
and pass itpython manage.py migrate
as arguments. Sincepython
is not a shell script,bash
cannot execute it.Lose the
bash
:我终于能够通过首先进入heroku上的bash,然后运行我想要的命令来解决这个问题。步骤如下;
heroku run bash --app appName
~ $
python manage.py migrate
应该可以工作。ls -l
I was finally able to get around this by first getting into bash on heroku, then running the command I wish to. Steps are listed below;
heroku run bash --app appName
~ $
python manage.py migrate
which should work.ls -l $(ls)
orfind . -maxdepth 3 -type d -ls
or simplyls -l