Flask-Assets/webassets scss过滤器在我的本地机器上工作得很好,因为我安装了SASS。我的Elastic Beanstalk应用程序中的EC2实例没有,所以它会给出一个错误。
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?
发布于 2014-12-25 04:49:28
我能够通过sshing到实例中并运行以下命令来安装sass:
gem安装会话
要将其安装到所有新实例上,请将其添加到.ebextensions目录中的配置文件中
packages:
rubygems:
sass: ''空引号指定安装最新版本。如果您想要特定的版本,请在此处添加版本号。
更多信息在这里:
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#customize-containers-format-packages
https://stackoverflow.com/questions/24329786
复制相似问题