Cabal can't determine GHC version

人盡茶涼 提交于 2019-12-11 02:04:39

问题


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)



来源:https://stackoverflow.com/questions/19659929/cabal-cant-determine-ghc-version

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!