rspec-puppet-init command not found

In this troubleshooting guide we learn how to fix rspec-puppet-init command not found error message

Introduction

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

rspec-puppet-init: command not found

or when using sudo you get the following error message

sudo: rspec-puppet-init: command not found

Solutions to rspec-puppet-init: command not found

How To Fix rspec-puppet-init: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu rspec-puppet-init is provided by ruby-rspec-puppet package.

ruby-rspec-puppet is:

Puppet lets you centrally manage every important aspect of your system using a cross-platform specification language that manages all the separate elements normally aggregated in different files, like users, cron jobs, and hosts, along with obviously discrete elements like packages, services, and files.

This ruby module contains RSpec tests for Puppet manifests.

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

sudo apt-get -y install ruby-rspec-puppet

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

You can also use apt command to install ruby-rspec-puppet.

sudo apt -y install ruby-rspec-puppet

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

sudo aptitude install ruby-rspec-puppet

Summary

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