Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8127171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:25:56+00:00 2026-06-06T07:25:56+00:00

My goal is to build a simple custom guard with Guard . The gem

  • 0

My goal is to build a simple custom guard with Guard. The gem install and bundler install for my app went fine. My Guardfile contains:

notification :growl

guard 'eyeball' do
  watch %r{^app/(.*)}
  watch %r{^config/(.*)}
  watch %r{^lib/(.*)}
end

Ok, next, I need to tell Guard what to do when a match happens. But I don’t know where to do that. (In this case, I want to watch my application for changes and run some arbitrary code. Assume that there isn’t a guard available for what I want. I want to learn how to do it myself.)

In true ‘blunder and see what errors pop up next’ style, when I run guard I get this error message:

ERROR: Could not load 'guard/eyeball' or find class Guard::Eyeball
ERROR: cannot load such file -- guard/eyeball
ERROR: Invalid Guardfile, original error is:
undefined method `new' for nil:NilClass
ERROR: No guards found in Guardfile, please add at least one.
Guard uses Growl to send notifications.
Guard is now watching at '/Users/my-user-name/dev/my-project-name'

So, that gives me a hint that I need to create a guard/eyeball.rb file. Maybe? But how was I supposed to know this from the documentation?

I’ve read (several times) the very detailed and useful Guard README but haven’t found a good simple example that shows someone how to do ‘just the basics’ of writing your own guard. Unexpectedly, RailsCasts didn’t really answer my question either: see RailsCast #264 Guard.

Did I overlook something in the Guard README? Can you help or point to a good example? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T07:25:58+00:00Added an answer on June 6, 2026 at 7:25 am

    Sweet! I just found a Wiki page on the Guard wiki titled Create a guard that answers my questions. It was not mentioned in the README, so I had to dig for it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My goal is pretty simple: to use ant to build an EAR which contains
I am trying to figure out how to build a simple custom tag (for
Goal: simple browser app, for navigating files on a web server, in a tree
I am learning how to program and my goal is to build a simple
My goal is to build an engine that takes the latest HL7 3.0 CDA
Okay, so my goal is to build a easy to use protocol for sending
For homework, I need to build a small java application.The main goal is to
My (simple) war project builds fine using mvn:package at the command line, but fails
Good Afternoon, I'm currently trying to build something incredibly simple inside of the Google
I have a relatively simple goal: I want to create a Cocoa application which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.