0

I've got a funny error. My sass files are located on a Dropbox folder. I edit them locally on my dev pc, and then they're synced via Dropbox to the server. On the server I have a CentOS installed with CLI Dropbox service.

I have an app.scss file and a _settings.scss file included from app.scss. If I edit _settings.scss, the following error is thrown:

    error app.scss (Line 2: File to import not found or unreadable: settings.
Load paths:
  /www/psmb.dev/web/typo3conf/ext/speciality/Resources/Public/foundation/sass
  /usr/local/lib/ruby/gems/1.9.1/gems/compass-0.12.2/frameworks/blueprint/stylesheets
  /usr/local/lib/ruby/gems/1.9.1/gems/compass-0.12.2/frameworks/compass/stylesheets
  /usr/local/lib/ruby/gems/1.9.1/gems/zurb-foundation-4.3.1/scss
  Compass::SpriteImporter)

If I then change something in app.scss, it's compiled without error. Now the funny thing: if I edit _settings.scss locally on the server, or via ssh, then no error is thrown!

What's up?

Dmitri Pisarev
  • 1,114
  • 12
  • 31
  • May be `_settings.scss` is locked while it synchronize and watcher can't compile it? – Alex Mar 12 '14 at 14:52
  • But why would it need a write access when compiling? – Dmitri Pisarev Mar 12 '14 at 18:22
  • Hz, try issues from [this](http://stackoverflow.com/questions/15511874/file-to-import-not-found-or-unreadable-compass) question – Alex Mar 13 '14 at 08:47
  • @Pinal what exactly do you suggest? `compass compile`? Of course it works, but up until next change... – Dmitri Pisarev Mar 13 '14 at 12:27
  • I've temporary found a workaround with setting up an ftp sync for my scss folder in Sublime Text, but that's not very elegant... – Dmitri Pisarev Mar 13 '14 at 12:29
  • May I suggest you describe your situation more explicitly. i.e. first when was your edit done (on which machine), then on which machine was the compilation performed, at what time sequence did the event occur, etc? – firemana Mar 18 '14 at 08:08
  • @firemana Sorry, but I think my question clearly states, that I make edits on my developer machine, and they immediately get synced to the server via Dropbox, where they are compiled by `comapass watch`. What else should I write? – Dmitri Pisarev Mar 18 '14 at 13:49
  • It was initially unclear to me that the compilation occured on the server. Anyway I have the same suspicion as Pinal that dropbox screwed up your file rights, or moved your path. May I know if the following is true: 1. After a setting file synced over by dropbox, compilation consistently fail no matter how long you wait. 2. The same setting file that fail compilation will be working after you edit it on server?. – firemana Mar 18 '14 at 14:10
  • OKay, here's a definitive test. I run `compass watch`, change `_settings.scss` -- it fails, as always. Now, without changing anything, I halt `compass watch` and run it again -- everything is compiled without problem. So the error occurs only in the moment, when Dropbox triggers the file change and `compass watch` tries to get at it at the very same instant... – Dmitri Pisarev Mar 20 '14 at 14:56
  • So it means compass watch caught the file change "too early" while dropbox process is in the midst of making complete sync of the file. The file sync is probably implemented by 2 or more successive file update steps. – firemana Mar 20 '14 at 15:34
  • Yep, exactly. I guess something could be tweaked in how `compass watch` watches for changes, but this is outside of my scope of competence. I'm going to stick with ftpsync for scss files, it seems to be quicker, in any case. Thanks for suggestions everyone! – Dmitri Pisarev Mar 21 '14 at 05:23
  • @firemana can you provide your last comment as an answer, so I could accept it? It seems to be the closest we can get. – Dmitri Pisarev Mar 21 '14 at 05:25

2 Answers2

1

After some suggestion and Dmitri's test verification, we came to the conclusion that most likely compass watch caught the file change "too early" while dropbox process is in the midst of making complete sync of the file. The file sync is probably implemented by 2 or more successive file update steps.

Potentially the problem can be resolved if compass watch's compile trigger can be delayed somewhat. For now Dmitri decided to use ftpsync instead.

firemana
  • 487
  • 4
  • 7
0

Make sure that you are using linux line endings in your SASS files, as that is probably making it fail to compile.

When you edit it in windows, it's probably setting it to the windows line ending.

When you then edit it in CentOS, it's probably settings them to the unix line ending.

Harry Torry
  • 373
  • 5
  • 25
  • Thanks for the suggestion, but that's not the case. If I make edits via ftp auto sync in Sublime Editor on my local machine, and not via Dropbox sync, everything is OK. The problem seems to be with the Dropbox sync itself, but I don't see how it is possible. Even if Dropbox locks write access during syncing, it should not lock read access, and for compass to compile, read access should suffice, right? – Dmitri Pisarev Mar 18 '14 at 13:55
  • still, Harry's suspicion might be valid. FTP programs have feature to auto convert line-endings between win and unix systems, you need to check if your FTP in sublime is doing that for you. Dropbox do not have such capability. – firemana Mar 19 '14 at 09:30
  • See my comment to the above answer. – Dmitri Pisarev Mar 20 '14 at 14:56