Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Livereload on Rails not showing SCSS changes

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.
like image 453
ilyo Avatar asked Oct 20 '22 19:10

ilyo


1 Answers

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.

like image 166
velvetkevorkian Avatar answered Oct 22 '22 19:10

velvetkevorkian