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.

I have install the Yo angular and runs the followings commands:

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

and when i run the command grunt serve i have got this error. i have latest node and npm install with latest grunt and yo.

matthijsb
  • 909
  • 5
  • 12

8 Answers8

36

I had ruby install @squiroid. I forget to run gem install compass. That worked for me.

  • 1
    this is not the thank you answer this the solution for my problem. and i have answer my question so anyone who are facing this problem will found the correct solution. –  Jun 23 '15 at 10:32
  • I had to run `sudo apt-get install ruby-compass` first – DDS Jun 06 '18 at 18:58
16

I've the same problem in ubuntu and I did this to solve my problem :

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

after that grunt serve works

Gujarat Santana
  • 9,854
  • 17
  • 53
  • 75
  • I had installed ruby, and had installed compass gem, but for some reason I had to install apt-get ruby-compass still, as suggested here. Thanks! – Kyle Baker Jan 31 '17 at 19:46
  • 2
    I use this solution, It's needed to install ruby-compass with apt, if not in ubuntu doesnt work. THANKS !!! – anibal Apr 04 '17 at 14:04
9

I had the same problem I installed compass gem on my desktop and it is resolved.

If you're on OS X or Linux you probably already have Ruby installed; test with ruby -v in your terminal. When you've confirmed you have Ruby installed, run gem update --system && gem install compass to install Compass and Sass.

For windows you can download ruby and then install compass.

Hope it helps :)

squiroid
  • 13,809
  • 6
  • 47
  • 67
  • You should actually probably not use the installed version of ruby on your system, if you're on Ubuntu. See: https://stackoverflow.com/questions/37720892/you-dont-have-write-permissions-for-the-var-lib-gems-2-3-0-directory/37956249 – Kyle Baker Jan 31 '17 at 19:43
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!

ddb
  • 2,423
  • 7
  • 28
  • 38
Mbuso Mkhize
  • 89
  • 1
  • 4
  • Thanks this is great. Bad part is i'm not even using ruby. NET web api with angular front end. – Randy R May 10 '17 at 02:38
  • me too. Trust me it works. The ruby is so that the css pre-compiler sass/or less can run. At Least when running locally – Mbuso Mkhize Jun 21 '17 at 08:02
  • works perfectly. Although I have to open command prompt with ruby. Know a way to open ConEmu with ruby? because ruby didn't install globally on my system. So I can't just use it anywhere. Don't know why. – Uzumaki Naruto Dec 13 '17 at 07:12
5

I had the same problem

"yo angular" with sass option will use the compass, which is a ruby gem.

Install the ruby, and the compass

In windows system we also need to set the path of ruby. Add the ruby/bin to path

Then "grunt serve" works!

andyCao
  • 83
  • 1
  • 5
  • Thanks for this. Everything else I read just said to update compass, and no other Windows specific solutions mentioned ruby needed to be added to the path. – Mike.C.Ford Mar 30 '16 at 15:55
  • Adding .RB and .RBW to the environement Variable Value list as %PATHEXT%;.RB;.RBW and click OK. checkout http://www.tutorialspoint.com/ruby/ruby_installation_windows.htm – Afshin Ghazi Jun 16 '16 at 18:50
1

I have those problems too, I found a temporary fix by setting the source maps to false.

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

after that, it works like charm.

Shawn Mehan
  • 4,513
  • 9
  • 31
  • 51
Franz
  • 86
  • 2
  • 6
1

From the document of grunt-contrib-compass, that says:

"This task requires you to have Ruby, Sass, and Compass >=1.0.1 installed" and "When you've confirmed you have Ruby installed, run gem update --system && gem install compass to install Compass and Sass."

I followed this instruction and fixed the warning.

0

If you have the same strange feeling about Ruby when using node+express+Angluar, run "yo angular xyz", but use gulp instead of grunt.

OSP
  • 1,458
  • 1
  • 14
  • 15