我的Lessc出了什么问题?

时间:2015-05-07 08:31:04

标签: django python-2.7 less

我有一个django项目,我用ubuntu 14运行(作为虚拟机中的客户操作系统)。现在,当我启动django服务器时,我收到一条关于lessc的错误消息,我并不完全理解。你能帮帮我吗?

Environment:


Request Method: GET
Request URL: http://xxxxx.xxx.se:8000/xxx/

Django Version: 1.6.2
Python Version: 2.7.6
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.staticfiles',
 'pagination',
 'django_cas',
 'south',
 'haystack',
 'djcelery',
 'rosetta',
 'compressor',
 'django_nose',
 'social.content',
 'social.subscription',
 'social.tag',
 'social.comment',
 'social.group',
 'social.post',
 'social.overview',
 'social.wiki',
 'social.util',
 'social.upload',
 'social.users',
 'social.toolbar',
 'social.search',
 'social.servicelinks',
 'social.link',
 'social.terms',
 'social.tracking',
 'social.event',
 'social.notifications',
 'social.activity',
 'social.oembed',
 'social.survey',
 'social.services')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'social.kthcas.middleware.ContextLoggingMiddleware',
 'django_cas.middleware.CASMiddleware',
 'social.kthcas.middleware.CheckSSOMiddleware',
 'django.middleware.doc.XViewMiddleware',
 'pagination.middleware.PaginationMiddleware',
 'social.util.middleware.RequestScope',
 'social.util.middleware.CheckLanguageCookie',
 'social.util.minidetector.Middleware',
 'social.util.middleware.SuperuserMiddleware')


Template error:
In template /etc/social/social/social/templates/global.html, error at line 24
   /bin/sh: 1: /usr/local/bin/lessc: not found

   14 : 


   15 :     <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}js/lib/tiny_mce/skins/lightgray/skin.min.css?v=4"/>


   16 :     <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}js/lib/jquery-ui/css/smoothness/jquery-ui.min.css"/>


   17 :     <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}js/lib/tiny_mce/plugins/tinywebtex/css/dialog.css?v=4"/>


   18 :     <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/global.css"/>


   19 :     <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/activitystream.css"/>


   20 :     <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/sidebar.css"/>


   21 :     <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/print.css"/>


   22 :     <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/webtex.css?v=4"/>


   23 :   {% endcompress %}


   24 :    {% compress css %} 


   25 :     <link rel="stylesheet" type="text/less" media="all" href="{{ STATIC_URL }}css/social.less"/>


   26 :   {% endcompress %}


   27 :   {% compress css %}


   28 :     <link rel="stylesheet" type="text/less" media="all" href="{{ STATIC_URL }}css/personal_menu.less"/>


   29 :   {% endcompress %}


   30 :   {% if SITE_CSS %}


   31 :     <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}{{ SITE_CSS }}"/>


   32 :   {% endif %}


   33 :   {% compress js %}


   34 :     <script type="text/javascript" src="{{ STATIC_URL }}js/lib/jquery-1.11.1.js"></script><!-- many depends on-->


Traceback:
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  114.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/etc/social/social/social/overview/views.py" in overview
  23.         'special_login_destination': '%s/home' % settings.DEFAULT_URL_PREFIX,
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/django/shortcuts/__init__.py" in render
  53.     return HttpResponse(loader.render_to_string(*args, **kwargs),
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/django/template/loader.py" in render_to_string
  169.         return t.render(context_instance)
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/django/template/base.py" in render
  140.             return self._render(context)
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/django/template/base.py" in _render
  134.         return self.nodelist.render(context)
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/django/template/base.py" in render
  840.                 bit = self.render_node(node, context)
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
  78.             return node.render(context)
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  123.         return compiled_parent._render(context)
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/django/template/base.py" in _render
  134.         return self.nodelist.render(context)
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/django/template/base.py" in render
  840.                 bit = self.render_node(node, context)
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
  78.             return node.render(context)
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  123.         return compiled_parent._render(context)
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/django/template/base.py" in _render
  134.         return self.nodelist.render(context)
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/django/template/base.py" in render
  840.                 bit = self.render_node(node, context)
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
  78.             return node.render(context)
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  123.         return compiled_parent._render(context)
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/django/template/base.py" in _render
  134.         return self.nodelist.render(context)
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/django/template/base.py" in render
  840.                 bit = self.render_node(node, context)
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
  78.             return node.render(context)
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/compressor/templatetags/compress.py" in render
  149.         return self.render_compressed(context, self.kind, self.mode, forced=forced)
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/compressor/templatetags/compress.py" in render_compressed
  108.             rendered_output = self.render_output(compressor, mode, forced=forced)
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/compressor/templatetags/compress.py" in render_output
  121.         return compressor.output(mode, forced=forced)
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/compressor/css.py" in output
  51.                     ret.append(subnode.output(*args, **kwargs))
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/compressor/css.py" in output
  53.         return super(CssCompressor, self).output(*args, **kwargs)
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/compressor/base.py" in output
  285.         output = '\n'.join(self.filter_input(forced))
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/compressor/base.py" in filter_input
  224.         for hunk in self.hunks(forced):
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/compressor/base.py" in hunks
  200.                 precompiled, value = self.precompile(value, **options)
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/compressor/base.py" in precompile
  254.                     return True, filter.input(**kwargs)
File "/home/developer/.virtualenvs/kthsocial/local/lib/python2.7/site-packages/compressor/filters/base.py" in input
  173.                 raise FilterError(err)

Exception Type: FilterError at /social/
Exception Value: /bin/sh: 1: /usr/local/bin/lessc: not found

2 个答案:

答案 0 :(得分:1)

它正在寻找/usr/local/bin/lessc中较少的编译器。你检查过它确实存在吗?

答案 1 :(得分:1)

尝试

sudo apt-get install npm
sudo npm install -g less