Bash can't find ghc after reinstalling?

bash, haskell, installation

Solution

The `bash` shell caches paths to commands that you've previously used. Using `which ghc` won't show this (because it's external to the shell and just queries the `PATH`), but `type` is a `bash`-internal command that will reveal this situation, so `type ghc` will show something like

ghc is hashed (/usr/local/bin/ghc)

The fix is easy. Either start a new shell (where you start from scratch), or clear the cache by saying `hash -r`.

Problem

I just reinstalled Haskell Platform (here is why) and after reinstalling the Haskell Platform I get: ``` Drews-MacBook-Pro:Blokus-AI drewgross$ ghc -bash: /usr/local/bin/ghc: No such file or directory ``` Any idea why? I suspect that this is something to do with my path or something like that but I haven't found anything weird yet. I can use ghc directly: ``` Drews-MacBook-Pro:Blokus-AI drewgross$ /usr/bin/ghc ghc: no input files Usage: For basic information, try the `--help' option. ``` And /usr/bin/ is in my path: ``` Drews-MacBook-Pro:Blokus-AI drewgross$ echo $PATH /Users/drewgross/.rvm/gems/ruby-1.9.3-p327/bin:/Users/drewgross/.rvm/gems/ruby-1.9.3-p327@global/bin:/Users/drewgross/.rvm/rubies/ruby-1.9.3-p327/bin:/Users/drewgross/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin ``` what else can I do?

Original source