简体   繁体   English

指南针提供失败,Docker组成

[英]Compass provision failing with Docker compose up

The error output in console: 控制台中的错误输出:

/var/lib/gems/2.1.0/gems/compass-core-    1.0.3/lib/compass/core/sass_extensions/functions/urls.rb:5:in `has?'
build-server_1        | [10:22:15] : undefined method `has?' for Sass::Util:Module (NoMethodError)
build-server_1        |         from /var/lib/gems/2.1.0/gems/compass-core-1.0.3/lib/compass/core/sass_extensions/functions/urls.rb:9:in `included'

It seems to be missing a method has but unsure what version of ruby or compass or any flags to add to the current file here to prevent this: 它似乎缺少一个方法has但不确定什么版本的ruby或指南针或任何标志添加到当前文件这里,以防止这种情况:

# install ruby RUN apt-get install -y -qq ruby-dev RUN apt-get install make RUN apt-get install rubygems -y

# install compass RUN gem install --no-rdoc --no-ri compass

Tried and replaced last ruby line with: 尝试并替换最后的红宝石线:

RUN apt-get install ruby-ffi -y

And

RUN apt-get install ruby-dev -y

and compass without the flags. 没有旗帜的指南针。

Any suggestions please? 有什么建议吗? This works on other machines. 这适用于其他机器。 I have recently done a fresh Win 10 install on this paticular one and reinstalled ruby on my machine with env path set to C:\\Ruby23-x64\\bin but wouldn't have thought this would affect installing modules and running in a docker container. 我最近在这个特殊的一个上做了一个全新的Win 10安装并在我的机器上重新安装了ruby,env路径设置为C:\\ Ruby23-x64 \\ bin但是不会想到这会影响安装模块并在docker容器中运行。

DOCKERFILE DOCKERFILE

version: '2'
services:
  node:
    build:
      context: .
      dockerfile: docker/dockerfiles/node-dev
    ports:
-     "3000:3000"
    expose:
-     "3000"
    volumes:
-     .:/usr/src/app
- /usr/src/app/node_modules
volumes_from:
- submissions
environment:
- NODE_ENV=development
links:
- mongo
submissions:
 build:
  context: .
  dockerfile: docker/dockerfiles/golang
 volumes:
- /files
 links:
- mongo
build-server:
 build:
  context: .
  dockerfile: docker/dockerfiles/build-server
 environment:
 - NODE_ENV=development
 volumes_from:
- node
links:
 - node
 ports:
 - "8080:8080"
build-server-admin:
build:
  context: .
  dockerfile: docker/dockerfiles/build-server-admin
environment:
- NODE_ENV=development
volumes_from:
- node
mongo:
 image: mongo

This have to be connected with release of sass 3.5. 这必须与sass 3.5的发布相关联。 You need to install correct version of sass before installing compass. 在安装指南针之前,您需要安装正确版本的sass。

RUN gem install --no-rdoc --no-ri sass -v 3.4.22
RUN gem install --no-rdoc --no-ri compass

I ran today to a similar issue with compass in a docker container: 我今天跑到一个类似的问题,在一个码头工人的容器中使用指南针:

[11:12:23] /var/lib/gems/2.1.0/gems/compass-core-1.0.3/lib/compass/core/sass_extensions/functions/urls.rb:5:in `has?'
[11:12:23] : undefined method `has?' for Sass::Util:Module (NoMethodError)
    from /var/lib/gems/2.1.0/gems/compass-core-1.0.3/lib/compass/core/sass_extensions/functions/urls.rb:9:in `included'
    from /var/lib/gems/2.1.0/gems/sass-3.5.0.pre.rc.1/lib/sass/script/functions.rb:632:in `include'

I've fixed it by adding in my docker file 我通过添加我的docker文件来修复它

RUN gem install sass

I'm not sure this is the best thing to do but it fixed the issue. 我不确定这是最好的事情,但它解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM