无法弄清楚如何在 netbeans 中使用 db:seed for Rails

发布于 2024-08-28 16:06:55 字数 167 浏览 3 评论 0原文

似乎无法让我的 seeds.rb 文件通过命令“rake db:seed”运行。我正在使用netbeans,而且我是rails的初学者,所以我可以做一些非常简单和愚蠢的事情=/。我知道你打算将 seeds.rb 文件放在 db 目录中,但 netbeans 似乎没有这个文件,或者可能已重命名它......有任何帮助吗?

can't seem to get my seeds.rb file to run through the command "rake db:seed". I'm using netbeans and I'm a beginner to rails, so I could be doing something really simple and stupid =/. I know you're meant to put your seeds.rb file in the db directory but netbeans doesn't seem to have one or might have renamed it... any help out there?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

溇涏 2024-09-04 16:06:55

rake 任务db:seed 将加载Rails 环境,然后加载并执行文件db/seeds.rb

如果您没有 db/seeds.rb 文件,请创建一个文件(如果需要,也创建 db 目录)。

The rake task db:seed will load the Rails environment and then load and execute the file db/seeds.rb.

If you do not have a file db/seeds.rb, then make one (and if necessary make the db directory too).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文