簡體   English   中英

Mac OS X 10.11的Haskell cabal問題? (不能滿足-package-id)

[英]Haskell cabal issue with Mac OS X 10.11? (cannot satisfy -package-id)

我在Mac OS X 10.11上針對El-capitan使用了最新的Haskell平台7.10.2-a( https://www.haskell.org/platform/mac.html )。

當我試圖安裝yesodcabal install yesod ,我有多個錯誤消息,例如:

Building email-validate-2.1.3...
Building http-api-data-0.2.1...
Building fast-logger-2.4.1...
Building http-date-0.0.6.1...
Failed to install crypto-random-0.0.9
Build log ( /Users/smcho/.cabal/logs/crypto-random-0.0.9.log ):
Configuring crypto-random-0.0.9...
Building crypto-random-0.0.9...
Preprocessing library crypto-random-0.0.9...
<command line>: cannot satisfy -package-id vector-0.11.0.0-730f99979d41c11c3a1ef069844b5f57
    (use -v for more information)
Failed to install email-validate-2.1.3
Build log ( /Users/smcho/.cabal/logs/email-validate-2.1.3.log ):
Configuring email-validate-2.1.3...

錯誤模式幾乎相同: cannot satisfy -package-id

例如, cabal install aeson給出的cannot satisfy -package-id attoparse...錯誤。

Resolving dependencies...
Configuring aeson-0.10.0.0...
Building aeson-0.10.0.0...
Failed to install aeson-0.10.0.0
Build log ( /Users/smcho/.cabal/logs/aeson-0.10.0.0.log ):
Configuring aeson-0.10.0.0...
Building aeson-0.10.0.0...
Preprocessing library aeson-0.10.0.0...
<command line>: cannot satisfy -package-id attoparsec-0.13.0.1-99b4df28644e63383f308c810764a8bb
    (use -v for more information)
cabal: Error: some packages failed to install:
aeson-0.10.0.0 failed during the building phase. The exception was:
ExitFailure 1

但是,似乎已成功安裝了attoparsec庫。

smcho@macho ~> cabal install attoparsec
Resolving dependencies...
All the requested packages are already installed:
attoparsec-0.13.0.1
Use --reinstall if you want to reinstall anyway.

可能是什么問題?

作為建議在這里 ,在cannot satisfy -package-id ,你所看到的可能是錯誤由於過時緩存。

如果運行ghc-pkg check警告您緩存已過期,則運行ghc-pkg recache可能會解決您的問題。

我整個上午都在遇到cannot satisfy -package-id問題(不是使用yesod,而是使用其他各種軟件包)。 ghc-pkg recache解決了我的問題。 希望這可以幫助。

這可能是有爭議的,但是隨着stack的出現,haskell平台和cabal(直接使用時)現在已基本棄用。

堆棧將:

  1. 自動為您安裝haskell( stack setup
  2. 自動沙箱(並在項目之間智能共享沙箱)
  3. 完全避免陰謀(以我的經驗)

我可以從brew安裝yesod。

卸載haskell-plaftorm

  • /Library/Haskell/bin/uninstall-hs thru 7.10.2

安裝ghc

  • brew install ghc
    • brew link ghc

安裝堆疊

  • brew install haskell-stack

安裝Yesod

  • stack install yesod
  • stack install yesod-bin

使用Yesod

使用Yesod進行開發

  • 我不確定,但是我必須先運行stack exec yesod build
  • stack exec yesod devel

使用Keter進行Yesod部署

  • 刪除config / keter.yaml中的第一行
  • stack exec yesod keter ,您將在dist / bin中獲得一個二進制文件,其中包含要運行的大多數必需文件。
  • 將二進制文件作為獨立服務器執行。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM