本文介绍了如何在OSX El Capitan上运行Haskell的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我昨天刚升级到Mac OSX El Capitan,发现我用来在终端上运行Haskell的方法不再有效。



我曾经运行过Haskell通过键入 cd(我的.hs文件所在的路径),然后输入 ghci ,最后输入:l(.hs文件名)



但它告诉我: -bash:ghci :命令未找到键入 ghci



时如何运行Haskell El Capitan?我对电脑并不熟悉,只是为了好玩而偶尔学习一些算法,所以请避免使用技术术语,并给我一些明确的步骤。

(我没有知道它有没有帮助,我发现这个,它表明没有必要重新安装整个平台,但我不知道如何下载并运行它从github连接的可执行文件。) 解决方案

Haskell用于将自己安装到 / usr / bin ,这与El Capitan中的新安全功能不兼容。因此,El Capitan安装程序简单地删除了 / usr / bin 中不属于此处的所有内容。



Haskell安装程序在中提供了一种替代方法,可以正常安装到普通的 / usr / local / bin 路径。你可以使用它。以下是说明:


  1. 下载。

  2. 右键单击并选择打开。 $ b
  3. 如果您不想重新安装整个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:

    1. Download the installer.
    2. Right-click and select "Open".
    3. 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 00:43