2

Hi i try to create a new proyect for yesod using stack, follow the quickstart tutorial; to create the scaffolding I use the command:

stack new my-project yesod-postgres && cd my-project

But when run stack exec -- yesod devel get:

cabal: At least the following dependencies are missing:
classy-prelude >=0.10.2,
classy-prelude-conduit >=0.10.2,
classy-prelude-yesod >=0.10.2,
data-default -any,
hjsmin >=0.1 && <0.3,
monad-logger ==0.3.*,
persistent >=2.0 && <2.6,
persistent-postgresql >=2.1.1 && <2.6,
persistent-template >=2.0 && <2.6,
safe -any,
yesod >=1.4.3 && <1.5,
yesod-auth >=1.4.0 && <1.5,
yesod-core >=1.4.17 && <1.5,
yesod-form >=1.4.0 && <1.5,
yesod-static >=1.4.0.3 && <1.6

I try with the command stack exec -- cabal install but get:

cabal: Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible with
Cabal. Use the flag --package-db to specify a package database (it can be used multiple times).

Thanks for the help

EDIT

The command to install the postgres library in ubuntu:

sudo apt-get install -y libpq-dev
oriaj
  • 768
  • 1
  • 16
  • 33

1 Answers1

8

As described in the Yesod quick start page, you have to do this inside the project:

stack build yesod-bin cabal-install --install-ghc
stack build

And then,

stack exec -- yesod devel
Sibi
  • 47,472
  • 16
  • 95
  • 163
  • thanks you are right my error was that run the command outside of the project; but it only work for the sqlite template; the postgres template send a error message when run `stack build` get: `You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application` – oriaj Aug 26 '16 at 13:53
  • @oriaj For postgres, you have to most likely install the server library separately. – Sibi Aug 26 '16 at 14:26