简体   繁体   English

Gobuffalo 错误“没有定义名为 development 的连接!”

[英]Gobuffalo error "There is no connection named development defined!"

In my go project I install gobuffalo:在我的 go 项目中,我安装了 gobuffalo:

go get github.com/gobuffalo/pop/...

And then I run soda migrate but I got this error There is no connection named development defined!然后我运行soda migrate但我收到此错误There is no connection named development defined!

Does anyone know what problem I am facing with?有谁知道我面临什么问题?

For me, I named the file database.yaml initially, changing the name of file to database.yml worked just fine.对我来说,我最初将文件命名为 database.yaml,将文件名更改为 database.yml 就可以了。

First a quick reply, explanation below.首先快速回复,解释如下。

  1. Delete the database.yml file.删除 database.yml 文件。
  2. Force soda to create the same file with the command "soda g config"强制 soda 使用命令“soda g config”创建相同的文件
  3. After that my "soda migrate" command stopped giving the error and worked.之后我的“soda migrate”命令停止给出错误并工作。 (Don't forget to put your db cofig details in the generated file in the first section (development) only) (不要忘记将您的数据库配置详细信息放在第一部分(开发)的生成文件中)

In Detail详细地

Actually I copied an old working directory of Go to create another one.实际上,我复制了 Go 的旧工作目录来创建另一个。 In the new place it was not working.在新的地方它不起作用。 I think that was the problem.我认为这就是问题所在。 If still not working try installing SODA and do the above in the new place, I did that also.如果仍然无法正常工作,请尝试安装 SODA 并在新位置执行上述操作,我也这样做了。 https://gobuffalo.io/documentation/database/soda/ https://gobuffalo.io/documentation/database/configuration/ https://gobuffalo.io/documentation/database/soda/ https://gobuffalo.io/documentation/database/configuration/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM