PhpStorm – Please set program to run! Install the SASS compiler

If you need to compile SCSS to CSS, you need to install the SASS compiler (gem install sass) and configure it as a file watcher for .scss files.

If you are trying to add Watcher in PhpStorm and that returning error ‘Please set program to run!‘ than follow next instructions.

sassphpstorm

Download and install Ruby for Windows www.rubyinstaller.org

Open console ‘Start Command Promt with Ruby’

gem install sass

if you got error like next

ERROR:  Could not find a valid gem 'sass' (>= 0), here is why:
              Unable to download data from https://rubygems.org/ - SSL_connect retur
    ned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (
    https://rubygems.org/latest_specs.4.8.gz)

type next

gem sources -a http://rubygems.org/

Confirm than you don’t really care about that specific warning, since you trust rubygems.org. Then:

gem install sass

Launch PhpStorm and create .scss file. PhpStorm ask to configure  File Watcher for this filetype, if no than go to the settings – File – Settings – File Watchers.
Add SCSS Watcher, and select path to the scss.bat

edit-watcher

Next Arguments and output paths will save your css file to the parent folder [../css]

Arguments: --no-cache --update $FileName$:$FileParentDir$/css/$FileNameWithoutExtension$.css

Working directory: $FileDir$

Output Paths: $FileParentDir$/css/$FileNameWithoutExtension$.css:$FileNameWithoutExtension$.css.map

Environment Variables:
– add new with next parameters:
Name – PATH
Value – ‘Path to Ruby folder \bin’

8d7b17e0fa

Good luck!

This Post Has One Comment

  1. Dam

    I recommend using node-sass it’s 10+ times faster
    npm install -g node-sass

Leave a Reply