4

我正在关注http://seanhess.github.io/2015/08/04/practical-haskell-getting-started.html以开始使用堆栈工具。

$> stack --version
Version 0.1.3.1, Git revision 908b04205e6f436d4a5f420b1c6c646ed2b804d7

在“安装 GHC”步骤中,我得到Permission denied

$> stack setup
Run from outside a project, using implicit global config
Using resolver: lts-3.2 from global config file: /Users/karl/.stack/global/stack.yaml
Preparing to download ghc-7.10.2 .../Users/karl/.stack/programs/x86_64-osx/ghc-7.10.2.tar.bz2.tmp: 
openBinaryFile: permission denied (Permission denied)

这是预期的(指南中的错误)还是中的错误stack

运行相同的命令sudo似乎可以解决问题。这是预期的方法吗?

$> sudo stack setup
Password:
Downloaded ghc-7.10.2.                                      
Installed GHC.     
stack will use a locally installed GHC
For more information on paths, see 'stack path' and 'stack exec env'
To use this GHC and packages outside of a project, consider using:
stack ghc, stack ghci, stack runghc, or stack exec

我正在运行全新安装的 OS X 10.10.4 (Yosemite)。

4

1 回答 1

3

感谢@user5402 的建议,我发现由于某种原因,~/.stack/programs它归根用户所有。

删除.stack目录stack setup后按预期工作。

于 2015-08-26T10:24:56.713 回答