Yesod和堆栈中缺少cabal依赖项

时间:2016-08-25 21:48:44

标签: haskell yesod cabal-install haskell-stack

您好我尝试使用堆栈为yesod创建一个新的proyect,按照quickstart教程;创建脚手架我使用命令:

stack new my-project yesod-postgres && cd my-project

但是当运行stack exec -- yesod devel时:

cabal: At least the following dependencies are missing:
classy-prelude >=0.10.2,
classy-prelude-conduit >=0.10.2,
classy-prelude-yesod >=0.10.2,
data-default -any,
hjsmin >=0.1 && <0.3,
monad-logger ==0.3.*,
persistent >=2.0 && <2.6,
persistent-postgresql >=2.1.1 && <2.6,
persistent-template >=2.0 && <2.6,
safe -any,
yesod >=1.4.3 && <1.5,
yesod-auth >=1.4.0 && <1.5,
yesod-core >=1.4.17 && <1.5,
yesod-form >=1.4.0 && <1.5,
yesod-static >=1.4.0.3 && <1.6

我尝试使用stack exec -- cabal install命令,但得到:

cabal: Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible with
Cabal. Use the flag --package-db to specify a package database (it can be used multiple times).

感谢您的帮助

修改

在ubuntu中安装postgres库的命令:

sudo apt-get install -y libpq-dev

1 个答案:

答案 0 :(得分:9)

Yesod quick start page所述,您必须在项目中执行此操作:

stack build yesod-bin cabal-install --install-ghc
stack build

然后,

stack exec -- yesod devel