[haskell]spotを動かしてみようとしたときのメモ

HaskellでJSON Web APIを作ると幸せになれるかもよ*1を読んで自分でもやってみたくなったので、とりあえずspotを動かしてみようと思った。

でまずhttps://github.com/fujimura/spotからspotをDLして、READMEにあるように

$ coffee -c -o static coffee/
$ runhaskell main.hs

してみたら`Network.Wai.Middleware.Static'が無い的なエラーがでる。
あ、と思ってscotty*2をDLして同じディレクトリに展開してもう一度runhaskell main.hsしたらText.Hastache.Contextが無い的なエラー。
で、cabal install hastacheしてもう一度runhaskell main.hsしたら、

InvalidYaml (Just "YamlException \"Yaml file not found: config/database.yml\"")

みたらconfig/database.ymlが無い、ほんでconfig/database.example.ymlがあるので、コピって作ってrunhaskell main.hsしたら、、、わーいなんとか動いた
しかし、

user error (SQLite3 returned ErrorCan'tOpen while attempting to perform open "db/development.sqlite3".)

と申されておる。

…続く

*1:http://blog.fujimuradaisuke.com/post/26887032662/haskell-de-json-web-api

*2:https://github.com/xich/scotty