I'm trying to run gulp-ruby-sass on Windows.
I've already installed Ruby and Sass like that:
$ 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 cd into the root directory of my project and run $ gulp styles
,
I get this:
[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've been searching for a solution to this problem for about two hours now and still haven't found one that would help me.
I had the same error, only in my situation sass
package wasn't installed in RubyGem.
You need to execute following command:
gem install sass
Use the Ruby installer and reinstall it. Then check the path checkbox. It should be resolved then.
Install Sass Using the Command Prompt
[CMD] + [R] type cmd hit [ENTER]
Type gem install sass
If you get an error message then it's likely you will need to use the sudo command to install the Sass gem. It would look like:
sudo gem install sass
4 Reboot the NODE command line. In fact you might want to reboot the system, most users do not do enough of that.
I've finally found a solution.
I had to manually add a path to my Ruby bin folder in Control Panel > System > Advanced > Environment Variables. Here i added a new variable named path with a path to my Ruby bin folder (C:\Ruby22-x64\bin).
Then I restarted my Node.js command prompt and got the output I was looking for.
Thank you, CDF, for you answer and effort! Even though I answered this question myself, I hope it will eventually help other people too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With