2017-07-28 92 views
0

我试图通过Flynn设置Cabot,这基本上就像一个内部的heroku。 当我部署eveything并尝试运行它时,我得到这个异常。脱机生成错误 - Django压缩机

OfflineGenerationError: You have offline compression enabled but key "88dbbdf7c5e6ceca63a19023be40a840" is missing from offline manifest. You may need to run "python manage.py compress". 

我读here对于COMPRESS_ROOT路径可能不是绝对的,这可能是问题,但是当我检查,我在日志中得到这些。对我来说似乎绝对。

[2017-07-28T13:50:24.4Z] ('\n \n \n \n STATIC & CCOMPRESS ARE ', '/app/cabot/collectedstatic/', '\n \n \n \n ') 
[2017-07-28T13:50:24.532943Z] ('\n \n \n \n STATIC & CCOMPRESS URL ARE ', '/static/', '\n \n \n \n ') 

我试着在构建过程中运行manage.py compress并得到以下错误。

当我跑manage.py压缩

Invalid template /app/.heroku/python/lib/python2.7/site-packages/django_filters/templates/django_filters/rest_framework/crispy_form.html: 'crispy_forms_tags' is not a registered tag library. Must be one of: 
    admin_list 
    admin_modify 
    admin_static 
    admin_urls 
    cache 
    compress 
    extra 
    i18n 
    jsonify 
    l10n 
    log 
    polymorphic_admin_tags 
    polymorphic_formset_tags 
    rest_framework 
    static 
    staticfiles 
    tz 
    Invalid template /app/.heroku/python/lib/python2.7/site-packages/rest_framework/templates/rest_framework/filters/django_filter_crispyforms.html: 'crispy_forms_tags' is not a registered tag library. Must be one of: 
    admin_list 
    admin_modify 
    admin_static 
    admin_urls 
    cache 
    compress 
    extra 
    i18n 
    jsonify 
    l10n 
    log 
    polymorphic_admin_tags 
    polymorphic_formset_tags 
    rest_framework 
    static 
    staticfiles 
    tz 
    Found 'compress' tags in: 
    /tmp/build/app/cabot/templates/cabotapp/shift_list.html 
    /tmp/build/app/cabot/templates/cabotapp/statuscheck_detail.html 
    /tmp/build/app/cabot/templates/registration/logout.html 
    /tmp/build/app/cabot/templates/cabotapp/about.html 
    /tmp/build/app/cabot/templates/cabotapp/setup.html 
    /tmp/build/app/cabot/templates/cabotapp/statuscheckresult_detail.html 
    /tmp/build/app/cabot/templates/cabotapp/instance_list.html 
    /tmp/build/app/cabot/templates/cabotapp/instance_confirm_delete.html 
    /tmp/build/app/cabot/templates/cabotapp/statuscheck_report.html 
    /tmp/build/app/cabot/templates/cabotapp/service_list.html 
    /tmp/build/app/cabot/templates/cabotapp/instance_detail.html 
    /tmp/build/app/cabot/templates/cabotapp/plugin_settings_form.html 
    /tmp/build/app/cabot/templates/cabotapp/alertpluginuserdata_form.html 
    /tmp/build/app/cabot/templates/registration/login.html 
    /tmp/build/app/cabot/templates/cabotapp/statuscheck_list.html 
    /tmp/build/app/cabot/templates/404.html 
    /tmp/build/app/cabot/templates/cabotapp/instance_form.html 
    /tmp/build/app/cabot/templates/cabotapp/subscriptions.html 
    /tmp/build/app/cabot/templates/cabotapp/service_detail.html 
    /tmp/build/app/cabot/templates/base.html 
    /tmp/build/app/cabot/templates/cabotapp/statuscheck_form.html 
    /tmp/build/app/cabot/templates/cabotapp/service_confirm_delete.html 
    /tmp/build/app/cabot/templates/cabotapp/statuscheck_confirm_delete.html 
    /tmp/build/app/cabot/templates/cabotapp/service_form.html 
    Compressing... CommandError: An error occurred during rendering /tmp/build/app/cabot/templates/cabotapp/shift_list.html: /bin/sh: 1: lessc: not found 

奇怪的是,如果我对我的本地搬运工运行它,它完美地运行。我试图在这里抛弃docker部分并使用procfile使用heroku像构建过程一样运行。 不知道解决方案可能是什么。

+0

它最后说“lessc not found”,那么,也许它没有找到lessc? :)“无效的模板”消息对我来说看起来不是一个严重错误。 – karyon

回答

0

Docker和Heroku都会有不同的基础机器。我相信你不是在Heroku上部署容器,而是在VM上部署容器,并且你正在Docker上进行本地测试。他们都不同。

假设在两种情况下的包管理apt,你应该在两个地方执行命令

apt list --installed 

,看看哪些包丢失了在Heroku。这将让你和这个问题的想法。

+0

嗯,你是对的。但由于某种原因,我似乎并未提供该软件包。 我甚至尝试使用 'https:// elements.heroku.com/buildpack/lookfirst/heroku-buildpack-apt'来安装 但是在压缩命令运行的时候它不可用:S,尽管apt安装发生在。 –

+0

你也可以推一个容器。看到这个链接https://github.com/heroku-examples/python-miniconda –