在openshift中使用MongoHQ部署的web2py:RuntimeError:没有可用的驱动程序(' pymongo',)

时间:2014-06-02 00:13:24

标签: openshift web2py mongohq

我正在尝试将我的应用部署到openshift,但是我收到了错误消息。以下是我的日志:

==> app-root/logs/web2py.log <==
127.5.151.1, 2014-06-01 18:08:10, GET, /admin/static/images/questions.png, HTTP/1.1, 304, 0.010710
127.5.151.1, 2014-06-01 18:11:12, HEAD, /, HTTP/1.1, 303, 0.000809
127.5.151.1, 2014-06-01 18:11:13, HEAD, /, HTTP/1.1, 303, 0.004810
127.5.151.1, 2014-06-01 18:41:05, GET, /MarkIt/, HTTP/1.1, 500, 5.459672
127.5.151.1, 2014-06-01 18:49:36, GET, /MarkIt/, HTTP/1.1, 500, 5.658112
127.5.151.1, 2014-06-01 18:54:00, GET, /MarkIt/, HTTP/1.1, 500, 5.682422
127.5.151.1, 2014-06-01 19:10:50, HEAD, /, HTTP/1.1, 303, 0.000960
127.5.151.1, 2014-06-01 19:10:50, HEAD, /, HTTP/1.1, 303, 0.001024
127.5.151.1, 2014-06-01 19:56:22, GET, /MarkIt/, HTTP/1.1, 500, 5.487744
127.5.151.1, 2014-06-01 20:04:03, GET, /MarkIt/, HTTP/1.1, 500, 5.431559

==> app-root/logs/python.log <==
[Sun Jun 01 20:04:02 2014] [error] DEBUG: connect attempt 4, connection error:
[Sun Jun 01 20:04:02 2014] [error] Traceback (most recent call last):
[Sun Jun 01 20:04:02 2014] [error]   File "/var/lib/openshift/538b85575973cad5cc000794/app-root/runtime/repo/libs/gluon/dal.py", line 7409, in __init__
[Sun Jun 01 20:04:02 2014] [error]     self._adapter = ADAPTERS[self._dbname](**kwargs)
[Sun Jun 01 20:04:02 2014] [error]   File "/var/lib/openshift/538b85575973cad5cc000794/app-root/runtime/repo/libs/gluon/dal.py", line 5240, in __init__
[Sun Jun 01 20:04:02 2014] [error]     if do_connect: self.find_driver(adapter_args)
[Sun Jun 01 20:04:02 2014] [error]   File "/var/lib/openshift/538b85575973cad5cc000794/app-root/runtime/repo/libs/gluon/dal.py", line 746, in find_driver
[Sun Jun 01 20:04:02 2014] [error]     raise RuntimeError("no driver available %s" % str(self.drivers))
[Sun Jun 01 20:04:02 2014] [error] RuntimeError: no driver available ('pymongo',)
97.77.53.27 - - [01/Jun/2014:20:03:56 -0400] "GET /MarkIt/ HTTP/1.1" 500 843 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/537.75.14"

我正在使用MongoHQ,如果我在本地运行,应用程序运行完全正常。

我连接到MongoHQ的方式是在db.py中:

if not request.env.web2py_runtime_gae:
    ## if NOT running on Google App Engine use SQLite or other DB
    #db = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all'])
    db = DAL("mongodb://username:password@oceanic.mongohq.com:10017/MarkIt",
    check_reserved=["mongodb_nonreserved",],  adapter_args={"safe":False})

我在web2py中只有一个应用程序使用MongoHQ,而那是我无法打开的应用程序。其他工作正常。

我认为这可能是依赖问题,但我不知道如何解决它。

我也做过rhc cartridge add mongodb-2.4 -a my app,但没有帮助。

0 个答案:

没有答案