尝试使用 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/