Compiling Sass in a WordPress theme using Grunt

I am developing a WordPress theme using the Underscores theme as my starter theme and I want to automatize the Sass compiling. For this purpose, I will go to use Grunt, a JavaScript Task Runner.

In this example, I will use a Laravel Homestead, a Vagrant Virtual Machine, as my development environment.

You need to have Ruby and Sass installed and in your PATH for this task to work

 

I was trying to compile some Sass files using Grunt when I get this error:

$ grunt
Running "sass:dist" (sass) task
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.

Aborted due to warnings.