waffl
waffl

Reputation: 5511

sass --watch not updating after initial launch (sass 3.1.16)

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

Upvotes: 11

Views: 10098

Answers (8)

alex
alex

Reputation: 331

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.

Upvotes: 0

Andrii Bogachenko
Andrii Bogachenko

Reputation: 1285

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

Upvotes: 0

user4973992
user4973992

Reputation:

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.

Upvotes: 1

Klevis Miho
Klevis Miho

Reputation: 859

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

Upvotes: 1

Sonu Gupta
Sonu Gupta

Reputation: 11

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

gem update sass

Upvotes: 1

Carlosin
Carlosin

Reputation: 509

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:)

Upvotes: 3

pjumble
pjumble

Reputation: 16960

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

Upvotes: 9

Marco Lazzeri
Marco Lazzeri

Reputation: 1808

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

Upvotes: 2

Related Questions