将 PostgreSQL 与 Yesod 一起使用时缺少 postgres.yml 文件
我在使用 PostgreSQL 作为 Yesod 的持久解决方案时似乎遇到了问题。
我按照“五分钟内 Yesod”指南中的步骤进行操作。
我使用脚手架创建了一个项目。当选择选项 t 时,一切都很顺利,我可以在以下位置看到该应用程序:http://localhost:3000
。
但是,当我选择 PostgreSQL 作为数据库时,在输入“yesod devel”命令后出现以下错误:
Registering FirstYesod-0.0.0...
Starting development server...
Starting devel application
devel.hs: InvalidYaml (Just "YamlException \"Yaml file not found: config/postgres.yml\"")
Devel application launched, listening on port 3000
Exit code: ExitFailure 11
这个 Yaml 文件是我应该添加的,还是安装过程应该提供的? 如果是这样,有人知道为什么它没有被创建吗?
我使用 PostgreSQL 8.4.9。它与 psql 和 PGAdmin III 配合良好
I seem to have a problem when using PostgreSQL as persistent solution for Yesod.
I followed the steps in the 'Yesod in five minutes' guide.
I used the scaffolder to create a a project. When choosing option t, all went well and I could see the application at: http://localhost:3000
.
However, when I choose PostgreSQL as database, I got the following error after typing the 'yesod devel' command
Registering FirstYesod-0.0.0...
Starting development server...
Starting devel application
devel.hs: InvalidYaml (Just "YamlException \"Yaml file not found: config/postgres.yml\"")
Devel application launched, listening on port 3000
Exit code: ExitFailure 11
Is this Yaml file something that should have been added by me, or should the installation process have provided it?
If so, does anyone have any idea why it wasn't created?
I use PostgreSQL 8.4.9. It works fine with psql and with PGAdmin III
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果你看一下,你会看到生成的 yml 和打开的文件有不同的名称:
并且:
所以只需复制(或移动)文件:
现在你会得到一个 postgresql 特定的新错误:
I'我不是数据库人员,但如果你知道这个问题的答案(就运行
psql
后要输入什么命令而言),那么我会洗耳恭听;-) 。If you look you'll see the generated
yml
and the opened file have different names:and:
So just copy (or move) the file:
Now you get a new error that is postgresql specific:
I'm not a DB person, but if you know the answer to this one (in terms of what commands to type after running
psql
) then I'm all ears ;-).