LoginSignup
2
0

More than 3 years have passed since last update.

【Haskell】Persistentをstack installするときに発生するエラー対処。>=0.9.0 is required but it could not be found.

Posted at

package.yamlにてpersistentを追加

// 略

dependencies:
- base >= 4.7 && < 5
- servant
- servant-server
- wai
- warp
- mysql
- persistent
- persistent-mysql

//  略

これをstack installすると、
以下のようなエラーがでてくる

samp-0.1.0.0: unregistering (missing dependencies: persistent-mysql)
pcre-light      > configure
pcre-light      > Configuring pcre-light-0.4.0.4...
pcre-light      > Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5: The program 'pkg-config' version
pcre-light      > >=0.9.0 is required but it could not be found.

pkg-configの0.9.0がほしいといわれているので

brew install pkg-config

再度 stack install
すると次に別のエラーがでてくる。

pcre-light      > configure
pcre-light      > Configuring pcre-light-0.4.0.4...
pcre-light      > build
pcre-light      > Preprocessing library for pcre-light-0.4.0.4..
pcre-light      > /private/var/folders/w2/g637mr_573g2x2xk0w0_gd840000gn/T/stack-117f885e2c24da9a/pcre-light-0.4.0.4/Base.hsc:103:10: fatal error: 'pcre.h' file not found
pcre-light      > #include <pcre.h>
pcre-light      >          ^~~~~~~~
pcre-light      > 1 error generated.
pcre-light      > compiling .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Text/Regex/PCRE/Light/Base_hsc_make.c failed (exit code 1)

pcreのヘッダファイルがないと言われている。
素直にこいつをインストールする。

brew install pcre

再度 stack installで解決。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0