我正在尝试使用MySQL运行一个脚手架的Yesod站点(在Ubuntu 16.04上)。但是当我尝试使用devel运行它时会发生以下错误:
app/devel.hs:2:1: error:
Failed to load interface for ‘Application’
It is not a module in the current program, or in any known package.
Unexpected: child process exited with ExitFailure 1
我已经尝试过(从项目文件夹中):
stack exec -- yesod devel
yesod devel
两者都产生错误。
它确实可以正常运行应用程序
stack install
stack exec my-project
答案 0 :(得分:2)
我有这个确切的错误并尝试删除项目并重新生成它没有运气。但是,一旦我升级了堆栈,它就能完美运行:
$ stack upgrade
Current Stack version: 1.3.2, available download version: 1.4.0
Newer version detected, downloading
...
$ stack exec -- yesod devel
...
ExitSuccess
Type help for available commands. Press enter to force a rebuild.
Starting devel application
Devel application launched: http://localhost:3000
答案 1 :(得分:-1)
lucas@lucas-ms-7673:~/Data/Projecten/basicwebsite$ stack clean
lucas@lucas-ms-7673:~/Data/Projecten/basicwebsite$ yesod devel
Yesod devel server. Enter 'quit' or hit Ctrl-C to quit.
Application can be accessed at:
http://localhost:3000
https://localhost:3443
If you wish to test https capabilities, you should set the following variable:
export APPROOT=https://localhost:3443
basicwebsite-0.0.0: unregistering (local file changes: Application.hs
Foundation.hs Handler/Comment.hs Handler/Common.hs Handler/Home.hs
Handler/Profile...)
basicwebsite-0.0.0: configure (lib)
Configuring basicwebsite-0.0.0...
basicwebsite-0.0.0: build (lib)
Preprocessing library basicwebsite-0.0.0...
[ 1 of 11] Compiling Settings ( Settings.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Settings.o )
[ 2 of 11] Compiling Settings.StaticFiles ( Settings/StaticFiles.hs,.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Settings/StaticFiles.o )
[ 3 of 11] Compiling Model ( Model.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Model.o )
[ 4 of 11] Compiling Import.NoFoundation ( Import/NoFoundation.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Import/NoFoundation.o )
[ 5 of 11] Compiling Foundation ( Foundation.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Foundation.o )
[ 6 of 11] Compiling Import ( Import.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Import.o )
[ 7 of 11] Compiling Handler.Comment ( Handler/Comment.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Handler/Comment.o )
[ 8 of 11] Compiling Handler.Common ( Handler/Common.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Handler/Common.o )
[ 9 of 11] Compiling Handler.Home ( Handler/Home.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Handler/Home.o )
[10 of 11] Compiling Handler.Profile ( Handler/Profile.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Handler/Profile.o )
[11 of 11] Compiling Application ( Application.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Application.o )
basicwebsite-0.0.0: copy/register
Installing library in
/home/lucas/Data/Projecten/basicwebsite/.stack-work/install/x86_64-linux/lts-8.5/8.0.2/lib/x86_64-linux-ghc-8.0.2/basicwebsite-0.0.0-TYYyVjSz8i3CoGALY18CQ
Registering basicwebsite-0.0.0...
ExitSuccess
Type help for available commands. Press enter to force a rebuild.
app/devel.hs:2:1: error:
Failed to load interface for ‘Application’
It is not a module in the current program, or in any known package.
Unexpected: child process exited with ExitFailure 1
Trying again
lucas@lucas-ms-7673:~/Data/Projecten/basicwebsite$ stack exec ghc-pkg list basicwebsite
/home/lucas/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/package.conf.d
(no packages)
/home/lucas/.stack/snapshots/x86_64-linux/lts-8.5/8.0.2/pkgdb
(no packages)
/home/lucas/Data/Bedrijf/Projecten/basicwebsite/.stack-work/install/x86_64-linux/lts-8.5/8.0.2/pkgdb
basicwebsite-0.0.0