Yesod ExitFailure 1安装脚手架应用程序时

Joa*_*eth 10 haskell yesod

我正在尝试安装我的第一个脚手架Yesod应用程序.当我运行cabal-dev install && yesod --dev devel它失败时使用ExitFailure 1.我使用sqlite进行持久化.

Application.hs:49:44:
No instance for (monad-logger-0.3.1:Control.Monad.Logger.MonadLogger
                   IO)
  arising from a use of `runMigration'
Possible fix:
  add an instance declaration for
  (monad-logger-0.3.1:Control.Monad.Logger.MonadLogger IO)
In the second argument of `Database.Persist.Store.runPool', namely
  `(runMigration migrateAll)'
In a stmt of a 'do' block:
  Database.Persist.Store.runPool dbconf (runMigration migrateAll) p
In the expression:
  do { manager <- newManager def;
       s <- staticSite;
       dbconf <- withYamlEnvironment
                   "config/sqlite.yml" (appEnv conf) Database.Persist.Store.loadConfig
                 >>= Database.Persist.Store.applyEnv;
       p <- Database.Persist.Store.createPoolConfig
              (dbconf :: PersistConfig);
       .... }
Failed to install testProject-0.0.0
cabal.exe: Error: some packages failed to install:
testProject-0.0.0 failed during the building phase. The exception was:
ExitFailure 1
Run Code Online (Sandbox Code Playgroud)

我试图按照此处的说明操作:http: //www.yesodweb.com/book/scaffolding-and-the-site-template未能找到有关此问题的任何信息.有什么缺失的线索?

Col*_*ett 7

使用Control.Monad.Logger中的一个runFooLoggingT函数.尤其是那里.runNoLoggingT

这可能比将自己固定在旧版本的库中要好得多!


mru*_*ueg 4

错误消息表明该MonadLogger IO实例丢失。问题是安装的版本monad-logger太新。包括您需要的monad-logger-0.2.4 实例monad-logger-0.3.0,而上面显然没有

解决方案:添加&& < 0.3.0monad-loggercabal 文件中的行并重做cabal install --only-dependencies一次。

(如果没有monad-logger一行,请添加一行,例如, monad-logger < 0.3.0.