haskell - cabal zlib 安装失败

标签 haskell cabal

尝试使用 cabal 安装 zlib 包时,使用命令:

cabal install --root-cmd=sudo --global zlib

安装失败并显示消息:

In-place registering zlib-0.5.4.1...
cabal: Error: some packages failed to install:
zlib-0.5.4.1 failed during the final install step. The exception was:
user error (Unable to find cabal executable at: /home/manu2/.cabal/bin/cabal)

很明显,manu2 不是我的电脑名。帮忙?

电脑使用 Chakra GNU/Linux 64 位 intel i7-230 CPU

最佳答案

因此,当您使用 root-cmd 安装时,它会调用 following路径:

   reexec cmd = do
      -- look for our own executable file and re-exec ourselves using a helper
      -- program like sudo to elevate privileges:
      self <- getExecutablePath
      weExist <- doesFileExist self
      if weExist
        then inDir workingDir $
               rawSystemExit verbosity cmd
                 [self, "install", "--only"
                 ,"--verbose=" ++ showForCabal verbosity]
        else die $ "Unable to find cabal executable at: " ++ self

因此可执行文件路径以某种方式解析为 /home/manu2/.cabal/bin/cabal 但随后在该路径上调用 doesFileExist 失败。为什么会出现这种情况显然取决于系统,但可以通过尝试相关代码片段来进一步调查...

关于haskell - cabal zlib 安装失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24333304/

相关文章:

haskell - 如何解析 SKI 组合微积分的左结合符号

haskell - 如何完全删除 cabal 安装的软件包?

haskell - 安装 Haskell Gloss

windows - 在 Haskell 中,如何在 Windows 上安装编码包?

unix - Cabal 未能安装 unix-2.7.0.0

haskell - 如何创建合适的 .tar.gz 文件以用于 `cabal upload` ?

haskell - 在 Haskell 中定义函数并在参数中进行计算

haskell - 在 Haskell 中隐式注册单元测试

haskell - Swift 中的函数式思维?

haskell - 使用 IO.readLn 从 Haskell 中的标准输入读取单行