2014-04-06 136 views
1

我試圖在heroku上部署web2py應用程序,雖然它在我的本地服務器上正常工作,但我在部署它時始終收到相同的故障單。 我現在困在它上了幾次,嘗試了這個以及來自幾個論壇的解決方案。 請任何幫助!部署Web2py到Heroku(Psycopg2錯誤)

Traceback (most recent call last): 
File "/app/gluon/restricted.py", line 217, in restricted 
    exec ccode in environment 
File "/app/applications/processos/models/db.py", line 21, in <module> 
    db = get_db(name=None, pool_size=10) 
File "/app/gluon/contrib/heroku.py", line 25, in get_db 
    db = DAL(os.environ[name], pool_size=pool_size) 
File "/app/gluon/dal.py", line 7787, in __init__ 
    raise RuntimeError("Failure to connect, tried %d times:\n%s" % (attempts, tb)) 
RuntimeError: Failure to connect, tried 5 times: 
Traceback (most recent call last): 
File "/app/gluon/dal.py", line 7766, in __init__ 
    self._adapter = ADAPTERS[self._dbname](**kwargs) 
File "/app/gluon/dal.py", line 2756, in __init__ 
    if do_connect: self.find_driver(adapter_args,uri) 
File "/app/gluon/dal.py", line 795, in find_driver 
    raise RuntimeError("no driver available %s" % str(self.drivers)) 
RuntimeError: no driver available ('psycopg2',) 

我在Mac OSX 10.9.2

回答

2

運行時,您需要使用的virtualenv具有PIP爲您的項目。在部署之前,您需要在項目的根文件夾中執行pip freeze > requirements.txt。 Heroku會查找此文件,並相應地安裝您的需求。 Heroku的文檔一般都很好。請參閱Getting started with python獲取更多幫助。

+0

Tks man!我擺弄了一些有關requirements.txt的工作。那麼我遇到了一個新問題。但是我解決了這個問題! TKS! – user1810228