gpt4 book ai didi

macos - 在 Mac 上安装 Haskell 软件包

转载 作者:行者123 更新时间:2023-12-02 03:26:20 40 4
gpt4 key购买 nike

我似乎无法在我的 Mac (10.6.8) 上安装一些 Haskell 软件包。我首先尝试了 Happstack,但失败了,然后我尝试了 Snap。

有时,当我运行 ghci 时,会出现段错误。

其他时候它的工作原理如下:

GHCi, version 7.4.2: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude>

尝试获取 Snap 时:

....
....
....
Loading package vector-0.10.0.1 ... linking ... done.
Loading package zlib-0.5.4.0 ... linking ... done.
Loading package zlib-bindings-0.1.1.3 ... linking ... done.
Loading package zlib-enum-0.2.3 ... linking ... done.
Loading package snap-core-0.9.3.1 ... linking ... done.
Loading package snap-server-0.9.3.3 ... linking ... done.
Loading package directory-tree-0.11.0 ... linking ... done.
cabal: Error: some packages failed to install:
snap-0.11.2 failed during the building phase. The exception was:
ExitFailure 11

我已经见过这个问题几次了,但没有什么能真正解决我的问题。有什么想法吗?

最佳答案

更新于 2021 年 5 月 22 日

您是否尝试过使用 homebrew ?它为您处理依赖关系。

使用 homebrew,您可以使用 brew 命令安装 ghccabal-install

$ brew install ghc cabal-install
==> Downloading https://ghcr.io/v2/homebrew/core/ghc/manifests/8.10.4
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/ghc/blobs/sha256:965f94c14b56e3db7b239860e0a1d577be0b27caf8adb6212710a7430ce723d3
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:965f94c14b56e3db7b239860e0a1d577be0b27caf8adb6212710a7430ce723d3?se=2021-05-23T05%3A15%3A00Z&sig=fkH7sUY44VCLV8hI%2BtZT%2B
######################################################################## 100.0%
==> Pouring ghc--8.10.4.big_sur.bottle.tar.gz
==> /usr/local/Cellar/ghc/8.10.4/bin/ghc-pkg recache
🍺 /usr/local/Cellar/ghc/8.10.4: 6,907 files, 1.5GB
==> Downloading https://ghcr.io/v2/homebrew/core/cabal-install/manifests/3.4.0.0
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/cabal-install/blobs/sha256:2c0c5cc90d4739515721557f8e9c02783b3b5f106033c5c09241657b4418b21f
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:2c0c5cc90d4739515721557f8e9c02783b3b5f106033c5c09241657b4418b21f?se=2021-05-23T05%3A15%3A00Z&sig=O7ylxHgq42YVADlzTacdRfY7W
######################################################################## 100.0%
==> Pouring cabal-install--3.4.0.0.big_sur.bottle.tar.gz
🍺 /usr/local/Cellar/cabal-install/3.4.0.0: 7 files, 39.6MB

安装后,您应该能够运行:

$ ghc
ghc: no input files
Usage: For basic information, try the `--help' option.

以及 Haskell 解释器 ghci:

$ ghci
GHCi, version 8.10.4: https://www.haskell.org/ghc/ :? for help
Prelude>

希望这有帮助!

关于macos - 在 Mac 上安装 Haskell 软件包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15709129/

40 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com