:exclamation::exclamation: Guard is currently accepting more maintainers/contributors. :exclamation::exclamation:
Guard automates various tasks by running custom rules whenever file or directories are modified.
It's frequently used by software developers, web designers, writers and other specialists to avoid mundane, repetitive actions and commands such as "relaunching" tools after changing source files or configurations.
Common use cases include: an IDE replacement, web development tools, designing "smart" and "responsive" build systems/workflows, automating various project tasks and installing/monitoring various system services.
For a full categorized list of known Guard plugins, look here: https://github.com/guard/guard/wiki/Guard-Plugins
If you have any questions about Guard or want to share some information with the Guard community, please go to one of the following places:
- Guard Wiki
- Google+ community.
- Google group.
- IRC channel
#guard(irc.freenode.net) for chatting.
- File system changes handled by our awesome Listen gem.
- Support for visual system notifications.
- Huge eco-system with more than 220 Guard plugins.
- Tested against Ruby 1.9.3, 2.0.0, 2.1.0, JRuby & Rubinius.
Two nice screencasts are available to help you get started:
The simplest way to install Guard is to use Bundler.
Add Guard (and any other dependencies) to a
Gemfile in your project’s root:
group :development do gem 'guard' end
then install it by running Bundler:
Generate an empty
$ bundle exec guard init
Run Guard through Bundler with:
$ bundle exec guard
If you are on Mac OS X and have problems with either Guard not reacting to file changes or Pry behaving strange, then you should add proper Readline support to Ruby on Mac OS X.
Avoiding gem/dependency problems
It's important that you always run Guard through Bundler to avoid errors.
If you're getting sick of typing
bundle exec all the time, try one of the following:
bundle binstub guardwill create
bin/guardin your project, which means running
bin/guard(tab completion will save you a key stroke or two) will have the exact same result as
bundle exec guard.
Or, for RubyGems >= 2.2.0 (at least, though the more recent the better), simply set the
RUBYGEMS_GEMDEPSenvironment variable to
-(for autodetecting the Gemfile in the current or parent directories) or set it to the path of your Gemfile.
(To upgrade RubyGems from RVM, use the
rvm rubygems command).
NOTE: this Rubygems feature is still under development still lacks many features of bundler
- Or, for RubyGems < 2.2.0 check out the Rubygems Bundler.
Add Guard plugins
Guard is now ready to use and you should add some Guard plugins for your specific use. Start exploring the many Guard
plugins available by browsing the Guard organization on GitHub or by searching for
When you have found a Guard plugin of your interest, add it to your
group :development do gem '<guard-plugin-name>' end
See the init section of the Guard usage below to see how to install the supplied plugin template that you can install and to suit your needs.
Guard is run from the command line. Please open your terminal and go to your project work directory.
Look here for a full list of Guard commands
Just launch Guard inside your Ruby or Rails project with:
$ bundle exec guard
Guard will look for a
Guardfile in your current directory. If it does not find one, it will look in your
directory for a
Please look here to see all the command line options for Guard
Before reporting a problem, please read how to File an issue.
Development / Contributing
See the Contributing Guide.
Open Commit Bit
Guard has an open commit bit policy: Anyone with an accepted pull request gets added as a repository collaborator. Please try to follow these simple rules:
- Commit directly onto the master branch only for typos, improvements to the readme and documentation (please add
[ci skip]to the commit message).
- Create a feature branch and open a pull-request early for any new features to get feedback.
- Make sure you adhere to the general pull request rules above.
- R.I.P. :broken_heart: Michael Kessler (@netzpirat, flinkfinger.com).
- Rémy Coutable.
- Thibaud Guillaume-Gentil (@thibaudgg, thibaud.gg).