当我运行“yesod devel”时,它说“devel.hs:Maybe.fromJust:Nothing
yesod init # created a project bbbb
...
cabal install && yesod devel
...
Registering bbbb-0.0.0...
Starting development server...
Starting devel application
devel.hs: Maybe.fromJust: Nothing
Web服务器没有监听端口(我无法在浏览器中打开网站)
有谁知道如何解决这个问题?
我的环境:
这是dist / devel.hs,创建了“yesod init”:
{-# LANGUAGE PackageImports #-}
import "bbbb" Application (withDevelAppPort)
import Data.Dynamic (fromDynamic)
import Network.Wai.Handler.Warp
(runSettings, defaultSettings, settingsPort, settingsHost)
import Data.Maybe (fromJust)
import Control.Concurrent (forkIO)
import System.Directory (doesFileExist, removeFile)
import System.Exit (exitSuccess)
import Control.Concurrent (threadDelay)
main :: IO ()
main = do
putStrLn "Starting devel application"
wdap <- (return . fromJust . fromDynamic) withDevelAppPort
forkIO . wdap $ \(port, app) -> runSettings defaultSettings
{ settingsPort = port
, settingsHost = "0.0.0.0"
} app
loop
loop :: IO ()
loop = do
threadDelay 100000
e <- doesFileExist "dist/devel-terminate"
if e then terminateDevel else loop
terminateDevel :: IO ()
terminateDevel = exitSuccess
我上传了bbbb目录中的所有文件,而Application.hs是 https://github.com/suztomo/LanguageStudy/blob/master/Haskell/Yesod/bbbb/Application.hs。
答案 0 :(得分:1)
在黑暗的答案中拍摄:检查你的cabal文件,你使用yesod-default 0.5。