Cannot get Compass to work

Hello,

I've struggled for hours now to make Compass work in PhpStorm.

What I did:

  1. Created a new standard project in PhpStorm
  2. Executed "compass init" in the CLI -> the config.rb and directories were created
  3. Added a FileWatcher "compass scss" with the automatic settings and changed the output path


Now when a .scss file is compiled, I always get the output "Individual stylesheets must be in the sass directory."

PhpStorm also completely ignores the content of the config.rb file.

Here are my settings:

compass.png
I also tried an absolute path for the input file using $UnixSeparators($FilePath$)$

Any ideas?

0
5 comments

You need to run compass from a directory where your config.rb is  located. And you are running it in $FileDir$ - a directory where the  currently modified .sass file is located
Please try changing your settings as follows:
Arguments: compile $ProjectFileDir$ $FilePath$
Working directory: $ProjectFileDir$
Output paths to refresh: $ProjectFileDir$/stylesheets

As for ignored config.rb contents, have you configured compass support in Settings/Compass Support? What do your settings look like? What PHPStorm version do you use?

0

Thanks for the fast reply.

Please try changing your settings as follows:


I did, but with the same results. I also tried executing compass.bat from the PATH environment to make sure, it is executed in the project directory. Still not working.

compass2.png

As for ignored config.rb contents, have you configured compass support in Settings/Compass Support? What do your settings look like?


Yes. Please see the screenshot in my first post, top right.

What PHPStorm version do you use?


EAP 8, PS-138.1751

0

There seems to be several Bugs.

The output "Individual stylesheets must be in the sass directory." is apparently a bug in Compass: https://github.com/Compass/compass/issues/1769

But there still seems to be a bug in PhpStorm, because the compass.rb configuration file is still ignored.

This is the Compass configuration in my project:
setting-compass.png
This is my watcher setting:
setting-watcher1.png
This is the ouput:

cmd.exe /D /C "C:/Program Files/Ruby200/bin/compass.bat" compile
Compass can't find any Sass files to compile.
Is your compass configuration correct?.
If you're trying to start a new project, you have left off the directory argument.
Run "compass -h" to get help.

Process finished with exit code 1

However, when I add the configuration file location to the arguments (compile --config $ProjectFileDir$/compass.rb) it works:
setting-watcher2.png
PhpStorm seems to ignore the Settings/Compass settings.

0

The second issue doesn't seem to have anything to do with PHPStorm... Compass settings (Settings/Compass Support) are only used for resolving Compass imports in code and aren't related to file watchers/compilation

All PHPStorm does when transpiling your SCSS files is listening to changes in SCSS files and running the command specified in your watcher settings (program [arguments]) from the directory specified as a working directory
Just try the following:
- open your system terminal (cmd.exe?), cd to your project directory
- run "C:/Program Files/Ruby200/bin/compass.bat" compile

what's the result?

0

The second issue doesn't seem to have anything to do with PHPStorm... Compass settings (Settings/Compass Support) are only used for resolving Compass imports in code and aren't related to file watchers/compilation

Ok, then everything is clear. Thanks for your help! I thought, PhpStorm would add the configuration file automatically when it is specified in Settings/Compass. Would have been handy though...

Now I just hope, the Compass bug gets fixed soon.

0

Please sign in to leave a comment.