我正在阅读使用 Vagrant 和 Ansbile ( https://github.com/nickhs/flask_skeleton ) 部署 Flask 应用程序的指南,但一直遇到我不知道如何修复的错误。
我运行以下... $ vagrant up db
...在我找不到任何答案的错误之前经历了相当多的步骤。
这些是完成的步骤...
[db] 运行配置器:ansible...
PLAY [dbservers] **************************************************************
GATHERING FACTS ***************************************************************
TASK: [update apt] ************************************************************
changed: [192.168.100.20]
TASK: [install base packages] *************************************************
changed: [192.168.100.20] => (item=libpq-dev,python-dev,python-setuptools,git,libevent-dev,python-psycopg2)
TASK: [install pip] ***********************************************************
changed: [192.168.100.20]
TASK: [add env variables] *****************************************************
changed: [192.168.100.20]
TASK: [install db server packages] ********************************************
changed: [192.168.100.20] => (item=postgresql,postgresql-contrib)
TASK: [update postgres db configuration] **************************************
changed: [192.168.100.20]
TASK: [update postgres client configuration] **********************************
changed: [192.168.100.20]
TASK: [link /vagrant to /srv/flask_skeleton] **********************************
changed: [192.168.100.20]
TASK: [install dependencies] **************************************************
changed: [192.168.100.20]
NOTIFIED: [source env variables] **********************************************
ok: [192.168.100.20]
NOTIFIED: [restart postgresql] ************************************************
PLAY [dbservers] **************************************************************
TASK: [create database user] **************************************************
TASK: [create database] *******************************************************
NOTIFIED: [build database] ****************************************************
failed: [192.168.100.20] => {"item": "", "rc": 1}
stdout: Traceback (most recent call last):
File "/srv/flask_skeleton/createdb.py", line 1, in <module>
from app import db
ImportError: cannot import name db
PLAY RECAP ********************************************************************
to retry, use: --limit @/var/tmp/ansible/vagrant-dbserver.retry
192.168.100.20 : ok=14 changed=12 unreachable=0 failed=1
谁能指出我正确的方向?