guard command not found

In this troubleshooting guide we learn how to fix guard command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

guard: command not found

or when using sudo you get the following error message

sudo: guard: command not found

Solutions to guard: command not found

How To Fix guard: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu guard is provided by ruby-guard package.

ruby-guard is:

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.

Features:

  • File system changes handled by awesome Listen gem.
  • Support for visual system notifications.
  • Huge eco-system with more than 220 Guard plugins.
  • Tested against Ruby 2.2.8, 2.3.5, 2.4.2, JRuby & Rubinius.

To fix this problem, we can install more using the command below.

sudo apt-get -y install ruby-guard

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install ruby-guard.

sudo apt -y install ruby-guard

Or if you have aptitude installed you can use the following command.

sudo aptitude install ruby-guard

Summary

In this tutorial we learn how to fix guard command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.