Before installing gnuplot, I set the environment variable GNUPLOT_DRIVER_DIR = /home/gnuplot/build/src. During the installation, something went wrong.
GNUPLOT_DRIVER_DIR = /home/gnuplot/build/src
I
As mentioned in the above answers, unset GNUPLOT_DRIVER_DIR should work if you have used export to set the variable. If you have set it permanently in ~/.bashrc or ~/.zshrc then simply removing it from there will work.
unset GNUPLOT_DRIVER_DIR
export
~/.bashrc
~/.zshrc