Cabal can't determine GHC version

2019-07-24 10:10发布

问题:

I am currently trying to update Cabal (1.14.0, cabal-install at version 0.14.0) by doing

cabal install cabal-install

However, this gives me an ExitFailure1 with the error

setup: The program ghc version >=6.4 is required but the 
version of /usr/bin/ghc could not be determined.

But I'm definitely running a version of GHC that is greater than that.

$ /usr/bin/ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.4.2

It might be important that I'm on OSX 10.8 and that I installed Haskell through the Haskell Platform download for Mac.

Does anyone have advice on how to fix or work around this issue? I haven't been able to find any documentation on this problem.

回答1:

Since you're on a Mac, why not try installing the excellent Homebrew package manager? Add /usr/local/bin to your PATH, and then it's just brew install cabal-install.

You can even brew install ghc haskell-platform.

To upgrade the package list, use brew upgrade, then you can see what needs updating with brew outdated and update them with brew update.

Of course, you can name individual packages to update also, and specify versions of packages. Homebrew keeps the "recipes" (Ruby scripts) for package management in its own git repository (by default in /usr/local).

Then you can get on with what you really wanted to do in the first place...write some code! (or build, in your case)



标签: haskell cabal