建立Yesod项目时,Cabal安装抛出ExitFailure 1

时间:2014-09-30 02:57:10

标签: haskell yesod

我是Haskell Web开发和框架的新手,我一直关注this tutorial。我已经运行yesod init来创建一个项目。然后我进入项目文件夹并运行:

$ cabal sandbox init
$ cabal install --enable-tests --reorder-goals --max-backjumps=-1 -j

我在这里和那里遇到了几个依赖问题,但到目前为止已经想到了所有这些。现在我在构建过程中遇到了一个错误,我似乎无法找到任何答案或修复。构建过程突然以ExitFailure 1结束。

以下是完整的错误消息:

Model.hs:13:1:
Illegal instance declaration for
  ‘ToBackendKey
     persistent-2.0.8:Database.Persist.Sql.Types.SqlBackend Email’
  (All instance types must be of the form (T t1 ... tn)
   where T is not a synonym.
   Use TypeSynonymInstances if you want to disable this.)
In the instance declaration for
  ‘ToBackendKey persistent-2.0.8:Database.Persist.Sql.Types.SqlBackend Email’

Model.hs:13:1:
Illegal instance declaration for
  ‘ToBackendKey
     persistent-2.0.8:Database.Persist.Sql.Types.SqlBackend User’
  (All instance types must be of the form (T t1 ... tn)
   where T is not a synonym.
   Use TypeSynonymInstances if you want to disable this.)
In the instance declaration for
  ‘ToBackendKey persistent-2.0.8:Database.Persist.Sql.Types.SqlBackend User’
cabal: Error: some packages failed to install:
Wordscape-0.0.0 failed during the building phase. The exception was:
ExitFailure 1

是否有其他人遇到过这样的错误/知道如何解决这个问题?任何帮助,将不胜感激。谢谢!

1 个答案:

答案 0 :(得分:4)

添加

{-# LANGUAGE TypeSynonymInstances #-}
Model.hs顶部的

应该修复它,就像升级到persistent-2.1一样(尽管明天你可能无法做到这一点)。