如果您不想重新安装整个Haskell平台,您只需运行同一篇文章,例如使用以下命令: curl -fsSL https://raw.githubusercontent.com/mzero/haskell-platform/master/ hptool / os-extras / osx / bin / activate-hs | sh
I just upgraded to Mac OSX El Capitan yesterday, finding that the method I used to run Haskell on terminal do not work anymore.
I used to run Haskell on terminal by typingcd (the path where my .hs file is in)
, then type ghci
, and finally type :l (.hs file name)
But it told me that -bash: ghci: command not found
when typing ghci
.
So how could I run Haskell on El Capitan? I am not familiar with computer and am just learning some algorithms occasionally for fun, so please avoid technical terms and give me some clear steps to follow.
(I don't know wether it helps or not, I found this links, it suggests there is no need to reinstall the whole platform, but I don't know how to download and run the executable file it attached from github.)
解决方案
Haskell used to install itself to /usr/bin
, which is incompatible with the new security features in El Capitan. Thus the El Capitan installer simply removed everything in /usr/bin
that doesn't belong there.
The new Haskell installer in your link provides an alternative that correctly installs to the normal /usr/local/bin
path. You can use it. Here are the instructions:
- Download the installer.
- Right-click and select "Open".
- Select "Open" again in the dialog box.
If you don't want to reinstall the whole Haskell platform, you can simply run the script from the same post, e.g. with the following command:
curl -fsSL https://raw.githubusercontent.com/mzero/haskell-platform/master/hptool/os-extras/osx/bin/activate-hs | sh
这篇关于如何在OSX El Capitan上运行Haskell的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!