【问题标题】:grunt build and grunt servegrunt build 和 grunt serve
【发布时间】:2015-05-19 14:10:14
【问题描述】:

当运行 grunt build 和 grunt serve 时,会出现以下警告:

Warning: You need to have Ruby and Compass installed and in your system PATH for this task to work. 
Use --force to continue.

Aborted due to warnings.

咕噜版本:

grunt-cli v0.1.13
grunt v0.4.5

操作系统:

Windows 7

如何解决这个警告?是否需要 Ruby 和 Compass 或者没有这些我可以继续?

【问题讨论】:

    标签: node.js gruntjs npm


    【解决方案1】:

    这取决于你的 Gruntfile,可能你必须安装 ruby​​ 和 compass 来执行你的任务。

    要在 Windows 中安装 ruby​​,您需要在 RubyInstaller for Windows 中下载安装程序。不要忘记以管理员身份打开安装程序。

    然后,要安装 compass,您需要 sass 和 compass。试试看:

    gem install sass
    gem install compass
    

    应该可以解决你的问题。

    【讨论】:

    • 安装 Ruby 并添加到路径中。如何运行 gem install sass 和 gem install compass ?顺便说一句,对我来说 grunt build --force 和 grunt serve --force 正在工作。谢谢
    【解决方案2】:

    尝试使用 NPM 安装以下软件包

     npm install grunt-contrib-sass ruby grunt-sass sass -g
    

    如果这不起作用,请尝试在您的环境中安装 Ruby。

    【讨论】:

      猜你喜欢
      • 2016-01-05
      • 1970-01-01
      • 2016-01-23
      • 1970-01-01
      • 1970-01-01
      • 2015-07-28
      • 1970-01-01
      • 2015-05-07
      • 2014-04-03
      相关资源
      最近更新 更多