5

I have the following setup: rails 4. all SCSS and HTML are in app/assets/stylesheets | templates

Gemfile:

gem 'guard'
gem 'guard-compass'
gem 'guard-shell'
gem 'guard-livereload'

Guardfile:

guard :livereload do
  watch(%r{app/assets/.+\.(css|html|png|jpg)})
end

Liverload is connected and waiting for changes

$ guard
19:45:10 - INFO - LiveReload is waiting for a browser to connect.
19:45:11 - INFO - Guard is now watching at '/Users/dev/myproject'
[1] guard(main)> 19:46:05 - INFO - Browser connected.
ilyo
  • 35,851
  • 46
  • 106
  • 159
  • possible duplicate of [Rails: Use livereload with Asset Pipeline](http://stackoverflow.com/questions/8031880/rails-use-livereload-with-asset-pipeline) – Spencer Jun 22 '15 at 22:11

1 Answers1

3

I'm having the same issue -- I think it's because Guard only watches for CSS changes, but the CSS isn't compiled until a request is made. If you edit your main stylesheet (or any with the .css.scss extension) should trigger a live-reload although partials won't. Adding scss to your guardfile should mean it picks up changes in partials, but it seems to trigger a full page refresh rather than injecting the styles.

I assume this is a misconfiguration on my part or possibly an update to one of the gems has broken something but I'm not sure how to begin tracking that down.

velvetkevorkian
  • 660
  • 1
  • 5
  • 13