If you prefer going through a GUI, that option is available. The following instructions is specific to Mac OS X and it works through the command line.
Note that this is not specific to Rails projects. This can work for any standalone front-end project.
You must first get access to the developer tools. This is needed to compile necessary components for this set-up. The easier way is to download the Developer Tools from the Mac App Store which is free. It's a heavy download weighing over 1.5GB but it includes an iOS emulator which is great for testing. The other option is to download the Command Line Tools (Downloads page). You will need a developer account which is free.
If you are using the Command Line Tools, a path or development environment must be set manually the first time. Do not invoke this if you're using the full Developer Tools since it will already be set to
Open Terminal.app and type (for Command Line Tools only):
$ sudo xcode-select -switch /
Update Gem system then install Bundler.
$ sudo gem update --system $ sudo gem install bundler
.guardfile attached to this gist into your home folder then type:
cd to your project and
compass init and configure the generated
config.rb file. Here's an example:
In your project folder, start the Guard, enable the Browser plug-in and start editing.
$ bundle exec guard
To exit enter
e and enter.
compass watch or the equivalent in Sass is not required since it is being handled through Guard::Compass. A huge plus of Guard is that it uses a single observer and the extensions handle specific details like communicating with the browser (LiveReload) or telling Compass to compile. Any modifications will be directed to specific Guard extensions based on
- As of this writing, invoking the
guardcommand directly does not work with
guard-livereload. The browser extension complains that the server is not running. (update: I now wrap the command in
bundle execwhich I haven't tested here.) To work around this use
guard start -iinstead (non-interactive mode). To exit,
ctl-c. I have not experienced this with my Homebrew install but for the default Ruby installation, this is a problem.