yesodを試す

ubuntu server 64bit 11.10 環境でyesodを始める

haskell-platformによると、ubutnu 11.10はhaskell-platform-2011.2.0.2がはいる。cabalは0.10.2が入った。

% sudo aptitude install haskell-platform
% sudo aptitude install libedit-dev libbsd-dev libgmp3-dev zlib1g-dev freeglut3-dev
% cabal update
// ここでコーヒータイム
% cabal install yesod

// pathを通す
% echo 'PATH=$HOME/.cabal/bin:$PATH' >> ~/.zshrc
% source ~/.zshrc

// init実行で対話モード
% yesod init
Welcome to the Yesod scaffolder.
I'm going to be creating a skeleton Yesod project for you.

What is your name? We're going to put this in the cabal and LICENSE files.

Your name: otmb
Welcome otmb.
What do you want to call your project? We'll use this for the cabal name.

Project name: yesodtest
Great, we'll be creating yesodtest today, and placing it in yesodtest.
What's going to be the name of your foundation datatype? This name must
start with a capital letter.

Foundation: Yesodtest
Yesod uses Persistent for its (you guessed it) persistence layer.
This tool will build in either SQLite or PostgreSQL or MongoDB support for you.
We recommend starting with SQLite: it has no dependencies.

We have another option: a tiny project with minimal dependencies.
Mostly this means no database and no authentication.

So, what'll it be?
s for sqlite, p for postgresql, m for mongodb, or t for tiny: m

次にプロジェクト作成

% cd yesodtest
% cabal configure -fproduction
Resolving dependencies...
Configuring yesodtest-0.0.0...
cabal: At least the following dependencies are missing:
hjsmin >=0.0.14 && <0.1,
persistent-mongoDB ==0.6.*,
yesod-default ==0.4.*,
yesod-static >=0.3.1 && <0.4

// 色々無いと怒られた
% cabal install hjsmin persistent-mongoDB  yesod-default yesod-static

// 気を取り直してconfigure
% cabal configure -fproduction
% cabal build