Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows 7 - How to resolve “You need to have Ruby and Sass installed and in your PATH for this task to work” Warning?

Most answers and solutions are related to OSX, it is focused in Windows 7:

I have installed Grunt & Grunt CLI globally. Then I did a npm install inside a project folder to install all dependencies.

No problems so far, but as soon as I try to run the "grunt build" command, I get this warning in my project:

 Warning: You need to have Ruby and Sass installed and in your PATH for
 this task to work. More info:
 https://github.com/gruntjs/grunt-contrib-sass Use --force 
 to continue.
like image 208
Alberto Montellano Avatar asked Feb 22 '16 13:02

Alberto Montellano


People also ask

Does Sass use Ruby?

It uses LibSass to provide the same API for compiling Sass and defining custom functions as Ruby Sass, except that it uses the SassC module instead of Sass . However, it doesn't yet support the same Importer API. You can also use the sassc-rails gem to plug smoothly into Ruby on Rails.


2 Answers

Ok. This worked for me:

1) Download Ruby from http://rubyinstaller.org/

2) When you install, check the 'PATH' option. This is the key.

3) Once installed, open the prompt (you can use interactive ruby) and write

gem install sass

Now it should work.

like image 182
Gaston K Avatar answered Oct 31 '22 10:10

Gaston K


Let's consider that newbie people most of the time try to use these commands:

 npm install ruby
 npm install sass

It won't work.

Solution:

  1. Download and install Ruby from here “http://rubyinstaller.org/”
  2. Execute in a command prompt window “gem install sass”

Only downloading Ruby independently it works. If you try npm install ruby it won't work.

Hope it helps to solve this problem in your case.

like image 25
Alberto Montellano Avatar answered Oct 31 '22 10:10

Alberto Montellano