I was trying to use ruby gems for the first time, so I had to add the gems to my $PATH variable. I accidentally set the PATH variable to the new value, rather than appending the new value.
export PATH = $PATH:new/path
DON’T DO THIS!
export PATH = new/path
I fixed it by logging out, and logging back in again. Setting or adding to the PATH variable in the terminal only modifieds the variable for the current login session; I think I could have just closed the terminal session instead of logging out. To modify the PATH variable permanently, modify the ~/.bashrc file to include this line:
export PATH = $PATH:$HOME/new/path/from/home
export PATH = $PATH:/new/path/from/root
If you’d like to read more, I got my information from a good ubuntuforums thread.