[英]Can't figure out how to use db:seed for rails in netbeans
can't seem to get my seeds.rb file to run through the command "rake db:seed". 似乎无法让我的seed.rb文件通过命令“ rake db:seed”运行。 I'm using netbeans and I'm a beginner to rails, so I could be doing something really simple and stupid =/. 我正在使用netbeans,并且是Rails的初学者,所以我可以做一些非常简单而愚蠢的= /。 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? 我知道您打算将您的seed.rb文件放在db目录中,但是netbeans似乎没有文件,或者可能已将其重命名了……那里有什么帮助吗?
The rake task db:seed
will load the Rails environment and then load and execute the file db/seeds.rb
. 瑞克任务db:seed
将加载Rails环境,然后加载并执行文件db/seeds.rb
。
If you do not have a file db/seeds.rb
, then make one (and if necessary make the db
directory too). 如果没有db/seeds.rb
文件,则创建一个(如果需要,还创建db
目录)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.