compass watch compiles once, fails to notice further changes

家住魔仙堡 提交于 2019-12-04 18:20:00

问题


I work with SASS + Compass on Windows 7. I recently upgraded SASS from 3.2.10 to 3.4.2 and Compass from 0.12.2 to 1.0.1. I did the upgrade by uninstalling the old versions and install the new versions using gem uninstall/install in the command prompt.

Now when I make changes to an SCSS file after running compass watch, only the first set of changes is noticed and compiled. After that compass watch just looks like it's watching for changes but in reality no other changes after the first are noticed. I have to terminate (Ctrl+C) and rerun compass watch. Adding --poll to the command doesn't seem to help.

This strange behavior wasn't happening before the upgrade.

How can I fix this?


回答1:


Turns out the latest version of Compass was the culprit. I uninstalled it and installed version 1.0.0 alpha 13 (I left Sass as is - latest version 3.4.2).

Ran compass watch but that compiled once and terminated itself with a "LoadError on line ['53'] of C: cannot load such file -- wdm..."

I switched to compass watch --poll and now everything is back to normal - Compass watches, compiles, watches, compiles...




回答2:


Uninstall both sass & compass:

gem uninstall sass
gem uninstall compass

Install - sass version 3.4.0

gem install sass -v 3.4.0

Install - compass version 1.0.1

gem install compass

Now you can run

compass watch 

without --poll




回答3:


In my case running compass clean helped.

Edit: Managed to completely remove the issue by cd-ing to the working folder (containing the config.rb) and running compass watch from there, rather than giving the compass watch the path as an argument.

cd /path/to/project-dirs
compass watch



回答4:


I've had exactly same problem. Fastest solution, try to downgrade your compass. It works fine for me. I'm using this version https://rubygems.org/gems/compass/versions/1.0.0.alpha.13. Remember to uninstall your gems first (gem uninstall compass). If "compass watch" command will not work, try compass watch --poll




回答5:


In my case, i was Using winscp for file transfer.
Compass watch didnot detect any changes in modified.

Did all the above mentioned changes but still did not work.
After hours of debugging found that winscp was preserving the file timestamp and that was causing the issue.

To fix that :
1) In your WinSCP go to Option -> Preferences -> Transfer
2) Edit the preset you are using 3) Uncheck the preserve timestamp option.

That's it!! And compass started detecting changes and writing them.




回答6:


One thing that fixed it for me was to put all my default styles in screen.scss and delete style.scss and style.css.



来源:https://stackoverflow.com/questions/25592225/compass-watch-compiles-once-fails-to-notice-further-changes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!