30
D:\Projects\mallspk>grunt serve
Running "serve" task

Running "clean:server" (clean) task
>> 0 paths cleaned.

Running "wiredep:app" (wiredep) task

Running "wiredep:test" (wiredep) task

Running "wiredep:sass" (wiredep) task

Running "concurrent:server" (concurrent) task
    Warning: Running "compass:server" (compass) task
Warning: Command failed: 'compass.bat' is not recognized as an internal or exter
nal command,
    operable program or batch file.
     Use --force to continue.

我已经安装Yo angular并运行以下命令:

npm install grunt --save-dev
npm install -g grunt-contrib-compass 
npm install -g compass
npm install
bower install
npm install  grunt-google-cdn

当我运行命令时,grunt serve我得到了这个错误。我有最新的节点和 npm 安装最新的 grunt 和哟。

4

8 回答 8

35

我有红宝石安装@squiroid。我忘记跑步了gem install compass。这对我有用。

于 2015-06-23T07:14:03.870 回答
16

我在ubuntu中遇到了同样的问题,我这样做是为了解决我的问题:

  1. sudo apt-get install ruby
  2. sudo apt-get install ruby-compass
  3. sudo gem install compass

之后grunt serve 工作

于 2016-04-26T03:55:35.297 回答
9

我有同样的问题,我在我的桌面上安装了 compass gem,它已经解决了。

如果您使用的是 OS X 或 Linux,您可能已经安装了 Ruby;在终端中使用 ruby​​ -v 进行测试。确认已安装 Ruby 后,运行 gem update --system && gem install compass 来安装 Compass 和 Sass。

对于 Windows,您可以下载ruby ​​,然后安装 compass。

希望能帮助到你 :)

于 2015-06-23T07:05:23.617 回答
7

I searched and searched ... until finally I got the answer to this problem.
In my case it happened when I was creating a new angularjs application with yeomen.

This answer is specific to windows users

Step 1: Install ruby http://rubyinstaller.org/downloads/

Step 2 : download rubygems Link : https://rubygems.org/rubygems/rubygems-2.6.8.zip

Step 3 : unzip rubygems-2.6.8.zip

Step 4 : open powershell (terminal/command line) to the rubygems-2.6.8 folder path.(location of the folder eg. c:\folder\folder)

Step 5 : in the powershell terminal run these commands

> ruby setup.rb

> gem install compass

enjoy!

于 2016-11-10T08:32:17.883 回答
5

我有同样的问题

带有 sass 选项的“yo angular”将使用指南针,它是一颗红宝石。

安装红宝石和指南针

在windows系统中我们还需要设置ruby的路径。将 ruby​​/bin 添加到路径

然后“咕噜咕噜”的作品!

于 2015-10-15T08:11:55.470 回答
1

我也有这些问题,我通过将源映射设置为 false 找到了一个临时解决方案。

server: {
        options: {
          sourcemap: false <--
        }
      }

在那之后,它就像魅力一样。

于 2015-10-24T20:51:17.607 回答
1

grunt-contrib-compass的文档中可以看出:

“此任务要求您安装 Ruby、Sass 和 Compass >=1.0.1”和“确认已安装 Ruby 后,运行 gem update --system && gem install compass 以安装 Compass 和 Sass。”

我按照此说明修复了警告。

于 2016-06-03T10:01:59.770 回答
0

如果您在使用 node+express+Angluar 时对 Ruby 有同样的奇怪感觉,请运行“yo angular xyz”,但使用gulp而不是 grunt。

于 2017-03-20T17:12:22.137 回答