首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在AWS Elastic Beanstalk上使用webassets scss过滤器

在AWS Elastic Beanstalk上使用webassets scss过滤器
EN

Stack Overflow用户
提问于 2014-06-20 22:36:24
回答 1查看 236关注 0票数 1

Flask-Assets/webassets scss过滤器在我的本地机器上工作得很好,因为我安装了SASS。我的Elastic Beanstalk应用程序中的EC2实例没有,所以它会给出一个错误。

代码语言:javascript
复制
   Traceback (most recent call last):
File "/opt/python/run/venv/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
  response = self.full_dispatch_request()
File "/opt/python/run/venv/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
  rv = self.handle_user_exception(e)
File "/opt/python/run/venv/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
  reraise(exc_type, exc_value, tb)
File "/opt/python/run/venv/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
  rv = self.dispatch_request()
File "/opt/python/run/venv/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
  return self.view_functions[rule.endpoint](**req.view_args)
File "/opt/python/run/venv/lib/python2.7/site-packages/flask_login.py", line 732, in decorated_view
  return func(*args, **kwargs)
File "/opt/python/run/venv/lib/python2.7/site-packages/flask_security/decorators.py", line 194, in decorated_view
  return fn(*args, **kwargs)
File "/opt/python/current/app/app/frontend/prep.py", line 427, in deliveries_outstanding
  ('created_at', 'Added'),
File "/opt/python/run/venv/lib/python2.7/site-packages/flask/templating.py", line 128, in render_template
  context, ctx.app)
File "/opt/python/run/venv/lib/python2.7/site-packages/flask/templating.py", line 110, in _render
  rv = template.render(context)
File "/opt/python/run/venv/lib/python2.7/site-packages/jinja2/environment.py", line 969, in render
  return self.environment.handle_exception(exc_info, True)
File "/opt/python/run/venv/lib/python2.7/site-packages/jinja2/environment.py", line 742, in handle_exception
  reraise(exc_type, exc_value, tb)
File "/opt/python/current/app/app/frontend/templates/prep/_model_list.html", line 4, in top-level template code
  {% from "macros/stickers.html" import render_sticker %}
File "/opt/python/current/app/app/frontend/templates/prep/_master.html", line 16, in top-level template code
  {% assets "css_prep" %}
File "/opt/python/run/venv/lib/python2.7/site-packages/webassets/ext/jinja2.py", line 181, in _render_assets
  urls = bundle.urls(env=env)
File "/opt/python/run/venv/lib/python2.7/site-packages/webassets/bundle.py", line 685, in urls
  urls.extend(bundle._urls(env, extra_filters, *args, **kwargs))
File "/opt/python/run/venv/lib/python2.7/site-packages/webassets/bundle.py", line 647, in _urls
  *args, **kwargs)
File "/opt/python/run/venv/lib/python2.7/site-packages/webassets/bundle.py", line 504, in _build
  force, disable_cache=disable_cache, extra_filters=extra_filters)
File "/opt/python/run/venv/lib/python2.7/site-packages/webassets/bundle.py", line 390, in _merge_and_apply
  filters_to_pass_down, disable_cache=disable_cache)
File "/opt/python/run/venv/lib/python2.7/site-packages/webassets/bundle.py", line 429, in _merge_and_apply
  kwargs=item_data)
File "/opt/python/run/venv/lib/python2.7/site-packages/webassets/merge.py", line 272, in apply
  return self._wrap_cache(key, func)
File "/opt/python/run/venv/lib/python2.7/site-packages/webassets/merge.py", line 219, in _wrap_cache
  content = func().getvalue()
File "/opt/python/run/venv/lib/python2.7/site-packages/webassets/merge.py", line 252, in func
  getattr(filter, type)(data, out, **kwargs_final)
File "/opt/python/run/venv/lib/python2.7/site-packages/webassets/filter/sass.py", line 141, in input
  self._apply_sass(_in, out, os.path.dirname(source_path))
File "/opt/python/run/venv/lib/python2.7/site-packages/webassets/filter/sass.py", line 122, in _apply_sass
  shell=(os.name == 'nt'))
File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
  errread, errwrite)
File "/usr/lib64/python2.7/subprocess.py", line 1308, in _execute_child
  raise child_exception
OSError: [Errno 2] No such file or directory

现在,我使用的是pyscss,但它的实现是有缺陷的,有时会生成不正确的css (例如,它弄乱了引导程序的SASS版本)。

有没有办法强制我的Elastic Beanstalk应用程序在所有实例上安装SASS?

EN

回答 1

Stack Overflow用户

发布于 2014-12-25 04:49:28

我能够通过sshing到实例中并运行以下命令来安装sass:

gem安装会话

要将其安装到所有新实例上,请将其添加到.ebextensions目录中的配置文件中

代码语言:javascript
复制
packages:
  rubygems:
    sass: ''

空引号指定安装最新版本。如果您想要特定的版本,请在此处添加版本号。

更多信息在这里:

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#customize-containers-format-packages

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24329786

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档