Gulp -ruby-sass - 'sass' is not recognized as an internal or external command, operating program or batch file

I am trying to run gulp -ruby-sass on Windows.

I already installed Ruby and Sass: $ gem install sass

My gulp.task looks like this:

 gulp.task('styles', function() { return sass('src/scss/**/*.scss') .on('error', sass.logError) .pipe(gulp.dest('css')); }); 

When I connect to the root directory of my project and run $ gulp styles , I get the following:

 [22:54:52] Using gulpfile c:\wamp\www\wordpress\ wp-content\themes\bootscores\gulpfile.js [22:54:52] Starting 'styles'... [22:54:52] 'sass' is not recognized as an internal or external command, operable program or batch file. Error in plugin 'gulp-ruby-sass' Message: Gem undefined is not installed. [22:54:52] Finished 'styles' after 89 ms 

I searched for a solution to this problem for about two hours and still have not found what helped me.

+6
source share
3 answers

I finally found a solution.

I had to manually add the path to my Ruby bin folder in Control Panel> System> Advanced> Environment Variables. Here I added a new variable named path with the path to my Ruby bin folder (C: \ Ruby22-x64 \ bin).

Then I restarted my Node.js command line and got the result I was looking for.

Thanks, CDF, for the answer and effort! Despite the fact that I myself answered this question, I hope that this will ultimately help other people.

+8
source

I had the same error, only in my situation the sass package sass not installed in RubyGem.

You need to run the following command:

 gem install sass 
+4
source

INSTALL RUBY

Use the Ruby installer and reinstall it. Then check the path box. Then it should be allowed.

  1. Install Sass using the command line

    [CMD] + [R] type cmd hit [ENTER]

    Type gem install sass

If you get an error message, most likely you will need to use the sudo command to install the Sass gem. It will look like this:

sudo gem install sass

4 Reload the NODE command line. In fact, you can reboot the system, most users do not have enough.

+2
source

All Articles