geocode command not found

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

Introduction

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

geocode: command not found

or when using sudo you get the following error message

sudo: geocode: command not found

Solutions to geocode: command not found

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

In Ubuntu geocode is provided by ruby-geocoder package.

ruby-geocoder is:

Geocoder is a complete geocoding solution for Ruby. With Rails, it adds geocoding (by street or IP address), reverse geocoding (finding street address based on given coordinates), and distance queries. It’s as simple as calling geocode on your objects, and then using a scope like Venue.near ("Billings, MT").

Designed for Rails but works well outside Rails, too.

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

sudo apt-get -y install ruby-geocoder

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

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

sudo apt -y install ruby-geocoder

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

sudo aptitude install ruby-geocoder

Summary

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