We’ve been experimenting with Ruby on Rails a bit lately and one of the things that we were missing out of the box was livereload. Turns out it’s not too tough to get it up an running.

The CliffsNotes

In your gemfile:

group :development do
  gem 'guard'
  gem 'rack-livereload'
  gem 'guard-livereload', require: false
end

In config/environments/development.rb

config.middleware.use Rack::LiveReload

Install new gems via terminal

bundle install

Create your Gaurdefile

bundle exec guard init

Launch Gaurd

bundle exec guard

Start your rails server in another terminal

rails server

The Details

  1. Install Guard, just follow the instructions on the repo https://github.com/guard/guard

  2. Install rack-livereload https://github.com/johnbintz/rack-livereload

  3. Install guard-livereload https://github.com/guard/guard-livereload

The Caveats

It always seems to take a bit to get up and running for some reason. Not sure why but it takes it compiles everything for you without any further configuration like you might have with a detailed Gruntfile. Super cool.

It would be nice if this could be built into some sort of boilerplate for rails projects. Something to research further I suppose…