11

I am working with sass to write the css for a simple static website I am working on. I have run sass --watch custom.scss:custom.css which compiles fine on launch with the message:

Sass is watching for changes. Press Ctrl-C to stop.

overwrite custom.css

However, whenever I update the .scss file, nothing happens. I haven't used SASS outside the context of a rails app before, so I'm wondering if I am missing something?

My scss file is incredibly simple as well, so I doubt it is choking on anything, especially since it works on the first run.

sass -v reports Sass 3.1.16 (Brainy Betty), on Lion 10.7.2

Community
  • 1
  • 1
waffl
  • 5,179
  • 10
  • 73
  • 123
  • what changes did you do? sometimes i don't think it prints anything if you didn't have changes and just saved the file(although i doubt that's what you did) – corroded Apr 26 '12 at 14:09
  • `sass --watch` in 3.1.16 doesn't work for me either (under Ubuntu, OSX or Windows - 3.1.15 worked fine). In the changelog for [3.1.16](http://sass-lang.com/docs/yardoc/file.SASS_CHANGELOG.html) it lists "Moved from FSSM to Listen for file-system monitoring." so perhaps that broke something. – pjumble Apr 26 '12 at 14:16
  • @corroded I'm definitely making changes :) – waffl Apr 26 '12 at 14:34
  • @pjumble - you are right, I just installed the listen gem and now it works! Odd it wouldn't say something about listen not being installed. If you want, make that an answer and I can choose it :) – waffl Apr 26 '12 at 14:38
  • My previously posted answer was incorrect, I'm seeing the same issue as well. Installing the Listen gem doesn't seem to help, though it may get rid of some warning messages if your're seeing any. – Josh Farneman Apr 26 '12 at 21:52
  • Here's a related issue on the Sass repo on Github: https://github.com/nex3/sass/issues/362 – Josh Farneman Apr 27 '12 at 13:39
  • The same problem is happening to me with sass 3.3.9. Tried the solutions mentioned below but without success. I'm on Windows 8.1 – Klevis Miho Jul 08 '14 at 16:09
  • I downgraded to SASS 3.2.9 and it works now. – Klevis Miho Jul 08 '14 at 16:55

8 Answers8

9

This has now been fixed in the latest commit.

The updated stable gem (3.1.17) hasn't been released yet but there are a few choices while you wait:

  1. Stick with 3.1.16 and use absolute paths when loading up watch, e.g:

    sass --watch /User/name/project/scss:/User/name/project/css
    

    The bug should only occur with relative paths so this works around it.

  2. Use the updated (alpha) version

    gem install sass --pre
    
  3. Temporarily roll back to 3.1.15 as suggested by @Marco Lazzeri

pjumble
  • 16,880
  • 6
  • 43
  • 51
  • Oddly enough, just installing the listen gem worked for me, but thanks for the resourceful answer! – waffl Apr 29 '12 at 09:54
3

As it is mentioned by pjumble, it is a known bug in process. You can use absolute path to address this problem, before a new version is release.

This is what I usually do to avoid typing a full path:

cd work-directory
sass --watch `pwd`/sass:`pwd`/css

Hope this work for you:)

Carlosin
  • 509
  • 6
  • 9
2

Same problem here.

I don't know exactly what the problem is, but rolling back to the previous version is a temporary workaround:

gem uninstall sass -v=3.1.16
gem install sass -v=3.1.15
Marco Lazzeri
  • 1,808
  • 19
  • 15
1

I too had the same problem. Just by updating my gem, it worked.

gem update sass
Anton Savin
  • 40,838
  • 8
  • 54
  • 90
Sonu Gupta
  • 11
  • 1
1

I had this problem too with the latest SASS version at this time. Downgrading to version 3.2.9 did the trick to me on 2 different Windows 8 computers.

gem uninstall sass
gem install sass -v 3.2.9
Klevis Miho
  • 851
  • 8
  • 15
1

I Had a similar problem: "Change detected", but then no writing despite it compiling and overwriting the .css file days before.

Notes:

  • Reinstalling sass in Ruby didn't work.

  • I pointed sass --watch at some other projects and they worked.

  • What seemed to create this problem was that I had made a copy of one project while it was being watched, then started watching the second project.

  • I can't say for sure but this seem to "trip up" Ruby, maybe it was the cache or some stored info about the file locations.

Solution:

I just created a newly named project folder, dragged into it all the scss files from the second project, renamed the main scss file (e.g. "uikit-main.scss" to "uikit.scss"), --watch it, and it began overwriting correctly again.

Kmeixner
  • 1,664
  • 4
  • 22
  • 32
0

I`ve also stuck with sass (v3.4.23) not recompiling after the first run, but it was realted with scss`s folder structure - Sass can`t watch changes in files that are located by the path directing upwards the watching file. Link for details

Community
  • 1
  • 1
Andrii Bogachenko
  • 1,225
  • 13
  • 20
0

In my case, the problem was because I'm using sass in a vagrant machine with ubuntu. I install and run sass directly from my host OS (Mac) and the watch mode starts to work.

alex
  • 323
  • 1
  • 2
  • 16