gm: command not found

Have You tried accessing the binary with the full path?

Maybe Your $PATH variable doesn't contain the default paths? echo $PATH should give something like:

[root@server ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

If it's empty, You may set the PATH variable with this command

export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

On CentOS possible default full paths are:

/usr/bin/gm - from package: GraphicsMagick

You may install the required package with command yum install {package}

On Debian possible default full paths are:

/usr/bin/gm - from package: GraphicsMagick

You may install the required package with command apt-get install {package}
Error in other languages:
gm: bevel nie gevind nie
gm: comandă negăsită
gm: comando não encontrado
gm: commande introuvable
gm: command not found
gm: käsku ei ole
gm: không tìm thấy lệnh
gm: komanda nerasta
gm: Kommando nicht gefunden.
gm: kommandot finns inte
gm: komut yok
gm: nie znaleziono polecenia
gm: níor aimsíodh an t-ordú
gm: no se encontró la orden
gm: no s'ha trobat l'ordre
gm: opdracht niet gevonden
gm: parancs nem található
gm: perintah tidak ditemukan
gm: príkaz nenájdený
gm: příkaz nenalezen
gm: команда не найдена
gm: командата не е открита
gm: 命令找不到
gm: コマンドが見つかりません