Cannot get Compass to work
Hello,
I've struggled for hours now to make Compass work in PhpStorm.
What I did:
- Created a new standard project in PhpStorm
- Executed "compass init" in the CLI -> the config.rb and directories were created
- 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:
I also tried an absolute path for the input file using $UnixSeparators($FilePath$)$
Any ideas?
Please sign in to leave a comment.
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?
Thanks for the fast reply.
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.
Yes. Please see the screenshot in my first post, top right.
EAP 8, PS-138.1751
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:
This is my watcher setting:
This is the ouput:
However, when I add the configuration file location to the arguments (compile --config $ProjectFileDir$/compass.rb) it works:
PhpStorm seems to ignore the Settings/Compass settings.
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?
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.