简体   繁体   English

Haskell Yesod问题

[英]Haskell Yesod problems

someone could help me?! 有人可以帮我吗?! I'm working in a Haskell Yesod site for college on a C9 workspace, I've already installed by command Yesod and update cabal, but when I try "stack build" command, this miserable error message appears: 我在Haskell Yesod网站上工作,在C9工作区上大学,我已经通过命令Yesod安装并更新了cabal,但是当我尝试“stack build”命令时,会出现这个可怜的错误消息:

 $ stack build

aulahaskell-0.0.0: build (lib + exe)
Preprocessing library aulahaskell-0.0.0...
[ 7 of 13] Compiling Handler.Cliente  ( src/Handler/Cliente.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Handler/Cliente.o )

/home/ubuntu/workspace/web2017/src/Handler/Cliente.hs:10:1: error:
    Failed to load interface for ‘Network.HTTP.Types.Status’
    It is a member of the hidden package ‘http-types-0.9.1’.
    Perhaps you need to add ‘http-types’ to the build-depends in your .cabal file.
    Use -v to see a list of the files searched for.

--  While building package aulahaskell-0.0.0 using:
      /home/ubuntu/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.24.2.0 build lib:aulahaskell exe:aulahaskell --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1

Seriously, I tried a bunch of things to fix it, but nothing is working =S 说真的,我尝试了很多东西来解决它,但没有任何工作= S.

Just read the error message carefully: 只需仔细阅读错误消息:

Failed to load interface for ‘Network.HTTP.Types.Status’
It is a member of the hidden package ‘http-types-0.9.1’.
Perhaps you need to add ‘http-types’ to the build-depends in your .cabal file.
Use -v to see a list of the files searched for.

The line Perhaps you need to add 'http-types' to the build-depends in your .cabal file tells you what to do: You must add http-types to the build-depends: section of the library aulahaskell in your cabal file. 该行或许您需要在构建中添加“http-types” - 依赖于.cabal文件,告诉您该怎么做:您必须将http-types添加到cabal文件库aulahaskellbuild-depends:部分。

If this does not help, please post your cabal file. 如果这没有帮助,请发布您的cabal文件。

How did you start the yesod project? 你是如何开始yesod项目的? It's recommended to do: 建议这样做:

stack new my-yesod-project yesod-(your database here)
cd my-yesod-project
stack build

Thank you, guys! 感谢你们! It was a problem on how I was starting the project, some files weren't installed on my workspace, so I delete the files, reinstall Yesod and cabal, create another new version after following this steps: https://www.yesodweb.com/page/quickstart 这是我启动项目的一个问题,我的工作区没有安装一些文件,所以我删除文件,重新安装Yesod和cabal,按照以下步骤创建另一个新版本: https://www.yesodweb。 COM /页/快速入门

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM