2013-02-04 85 views
4

當我嘗試部署到Heroku時,出現一英里長的錯誤列表。我遵循他們的指導開始,但顯然缺乏和不準確。Heroku/Django安裝pylibmc時出錯

我的設置是一個模塊,我的要求是由不同的.txt文件爲每個環境的文件夾:

settings/ 
    base.py 
    dev.py 
    heroku.py 

requirements/ 
    base.txt 
    dev.txt 
    heroku.txt 

我試圖在base.txt和heroku.txt部署到Heroku的與pylibmc==1.2.2 django-pylibmc-sasl==0.2.4 (它擴展了base.txt),並且仍然相同。

的Bug跟蹤(小樣本):

_pylibmcmodule.c:2097: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast 

     /app/.heroku/python/include/python2.7/intobject.h:38: note: expected ‘long int’ but argument is of type ‘struct PylibMC_Behavior *’ 

     _pylibmcmodule.c:2097: warning: passing argument 1 of ‘PyObject_SetAttrString’ from incompatible pointer type 

     /app/.heroku/python/include/python2.7/object.h:472: note: expected ‘struct PyObject *’ but argument is of type ‘struct PylibMC_Behavior *’ 

     _pylibmcmodule.c:2098: error: ‘PylibMC_McErr’ has no member named ‘name’ 

     _pylibmcmodule.c:2098: error: ‘PylibMC_McErr’ has no member named ‘exc’ 

     _pylibmcmodule.c:2098: warning: passing argument 2 of ‘PyModule_AddObject’ from incompatible pointer type 

     /app/.heroku/python/include/python2.7/modsupport.h:40: note: expected ‘const char *’ but argument is of type ‘struct PylibMC_Behavior *’ 

     _pylibmcmodule.c:2100: error: ‘PylibMC_McErr’ has no member named ‘name’ 

     _pylibmcmodule.c:2100: error: ‘PylibMC_McErr’ has no member named ‘exc’ 

     _pylibmcmodule.c: In function ‘init_pylibmc’: 

     _pylibmcmodule.c:2176: error: ‘LIBMEMCACHED_VERSION_STRING’ undeclared (first use in this function) 

     _pylibmcmodule.c:2176: warning: passing argument 3 of ‘PyModule_AddStringConstant’ from incompatible pointer type 

     /app/.heroku/python/include/python2.7/modsupport.h:42: note: expected ‘const char *’ but argument is of type ‘struct PylibMC_Behavior *’ 

     error: command 'gcc' failed with exit status 1 

     ---------------------------------------- 
     Command /app/.heroku/python/bin/python -c "import setuptools;__file__='/app/build/pylibmc/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-i0GDaz-record/install-record.txt failed with error code 1 in /app/build/pylibmc 
     Storing complete log in /app/.pip/pip.log 
!  Heroku push rejected, failed to compile Python app 

我發現this相關的帖子,那是什麼給了試圖將庫添加到base.txt的想法,但仍然沒有幫助。

回答

2

如果您在requirements.txt中存在Pylibmc,它將自動受支持。

擁有所有這些需求文件只是額外的開銷。檢查出Twelve-Factor's Dev/Prod Parity文章。