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?
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
.
One of your directories in your $PATH
has an executable symlink which points to the no-longer-existent /usr/local/bin/ghc
. To find out, type which ghc
in bash. If the result is indeed a symlink, simply delete it. If it's a custom script, you may want to rename it instead of deleting in case you happen to need it later.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With