【问题标题】:Testing with Travis CI an AngularJS application that uses SASS使用 Travis CI 测试使用 SASS 的 AngularJS 应用程序
【发布时间】:2014-06-30 02:28:28
【问题描述】:

我无法弄清楚为什么我的 TravisCI 构建在编译我的 SASS 文件时一直失败(在节点 0.10 上)。

我一直收到同样的错误:

Running "concurrent:test" (concurrent) task
Warning: Running "compass:dist" (compass) task
Warning: You need to have Ruby and Compass installed and in your system PATH for this task to work. More info: https://github.com/gruntjs/grunt-contrib-compass Use --force to continue.

Aborted due to warnings.

但是我已经安装了 sass 和 grunt-contrib-sass,你可以通过我的 .travis.yml 看到

language: node_js                                                                                                                              

before_install:                                                                                                                                
  - gem install sass                                                                                                                           

node_js:                                                                                                                                       
  - '0.8'                                                                                                                                      
  - '0.10'                                                                                                                                     

before_script:                                                                                                                                 
  - 'npm install -g bower grunt-cli karma'                                                                                                     
  - 'bower install'                                                                                                                            

script: grunt    

还有我的package.json(摘录)

"grunt-bower-install": "~1.0.0",                                                                                                          
"grunt-concurrent": "~0.5.0",                                                                                                              
"grunt-contrib-clean": "~0.5.0",                                                                                                           
"grunt-contrib-compass": "~0.7.2",                                                                                                         
"grunt-contrib-concat": "~0.3.0",                                                                                                          
"grunt-contrib-connect": "~0.5.0",                                                                                                         
"grunt-contrib-copy": "~0.4.1",            

有人知道会发生什么吗?

链接到我的 Travis 版本:https://travis-ci.org/dmatteo/ng-bootstrap-pure/builds

附言当然,我的语言环境grunt 正在完美地测试和构建

【问题讨论】:

标签: angularjs sass gruntjs travis-ci


【解决方案1】:

看来安装sass 还不够,还需要安装compass。 此外,我需要指定需要一个 GUI,这是在 before_install 的前两行中完成的

所以,这是有效的.travis.yml

language: node_js

before_install:
  - "export DISPLAY=:99.0"
  - "sh -e /etc/init.d/xvfb start"
  - gem install sass
  - gem install compass

node_js:
  - '0.10'
  - '0.11'

before_script:
  - 'npm install -g bower grunt-cli karma'
  - 'bower install'

script: grunt

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-06
    • 1970-01-01
    • 1970-01-01
    • 2023-03-22
    • 2020-06-15
    • 2020-07-27
    相关资源
    最近更新 更多