After following the instructions on the QuickStart, I'm seeing some errors in Yesod when bringing up a webpage. The errors end in:
...
cannot satisfy -package-id wai-extra-1.3.4.6-62543d69d10941dae1d9b206c3eb3067:
wai-extra-1.3.4.6-62543d69d10941dae1d9b206c3eb3067 is unusable due to missing or recursive dependencies: blaze-builder-conduit-1.0.0-1053545317cd68e3d51439dd9a0e622d zlib-conduit-1.0.0-b51dc7daf506ea4c5ecd031c5101d96a (use -v for more information)Build failure, pausing...
Hopefully related, the referenced tutorial has me run
cabal-dev install
on a fresh Yesod project, however that also gives me errors:
...
[1 of 1] Compiling Control.Monad.Logger ( Control/Monad/Logger.hs, dist/build/Control/Monad/Logger.o )
Control/Monad/Logger.hs:63:39: Module
System.Log.FastLogger' does not exportpushLogStr'Control/Monad/Logger.hs:63:72: Module
System.Log.FastLogger' does not exportLoggerSet'Control/Monad/Logger.hs:63:83: Module
System.Log.FastLogger' does not exportnewLoggerSet'Control/Monad/Logger.hs:63:97: Module
System.Log.FastLogger' does not exportdefaultBufSize' Failed to install monad-logger-0.3.3.0...
On this later set of errors, I came across a page suggesting the issue has been fixed (SO won't let me post more than 2 links, but Google the error and it comes right up).
Any ideas?
Thanks in advance!
I'd suggest using
cabal sandboxfor each Yesod project, rather than installing the Yesod platform as part of your system libraries. Think of a cabal sandbox as a localized collection of Haskell packages in a single project, so you could have different versions of a package, sayData.Text, in 2 different cabal sandboxes. Usingcabal sandboxtakes longer time for compilation but it makes things simpler for dependency resolution (read more here: (read more here: http://coldwa.st/e/blog/2013-08-20-Cabal-sandbox.html).cabal sandboxrequires acabalversion of at least 1.18 if I'm not mistaken.Alright, enough of the talk. Let's get started.
To get the latest
cabal, it's easier if you havecabalinstalled through a package manager, even if the package manager installs acabalwithoutcabal sandbox. Since you are on Ubuntu, just:Once you have some version of
cabalinstalled, run:If you see something along the lines of this:
Then congratulations, the version of
cabalthat you have supportscabal sandbox, just move on Once you have a Cabal with cabal sandbox section of the answer.If instead you see something like:
Then you will need a more modern version of cabal. Simply clone the cabal repository on github:
Go to the directory, and checkout the branch
Cabal-v1.18.1.2, like so:Then execute:
This should install
cabalin the$HOME/.cabal/binfolder. Be sure to prepend$HOME/.cabal/binto yourPATHenvironment variable, before the folder where the system'scabalis located.Once you have a Cabal with cabal sandbox
Based on what I read from the Yesod quick start guide, you will want to install the
yesod-binpackage. It's hackage page is here. Basically,yesod-binprovides you with ayesodbinary that allows you to initialize a scaffolded site. The latest version ofyesod-binis 1.2.5.6, and that's what we're going to install.Create a directory named
yesod-bin:Go into that directory, and set up a cabal sandbox in that it, like so:
Fetch the latest package list from hackage using:
Now, we are going to install the latest version of
yesod-bin, 1.2.5.6, in a cabal sandbox. However,yesod-binhas a dependency on themmorphpackage, which defaults to install version 1.01, and trying to installmmorph-1.01will result in an error message like the following:and installing
yesod-binwithout specifiy themmorphpackage version defaults to installingmmorph-1.0.1, resulting in the following error:which seems to be related to these 2 issues in the
mmorphgithub repo:However,
mmorphversion 1.0.0 works fine. As such, we will have to specify the version ofmmorphto be 1.0.0 when we installyesod-bin, like this:This will take quite some time.
cabal sandboxcreates a directory named.cabal-sandboxinside theyesod-bindirectory, and theyesodbinary (along with several other binaries from theyesod-binpackage) can be found in the.cabal-sandbox/binfolder. Simply add that folder into yourPATH, and you should be able to do theyesod initandyesod develas seen at the end of the quick start.