如何将seeds.rb推送到现有的Rails应用程序(在Heroku上)? [英] How to push seeds.rb to existing rails app (on Heroku)?

查看:71
本文介绍了如何将seeds.rb推送到现有的Rails应用程序(在Heroku上)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本地将所有应用程序的数据存储在seeds.rb中。但是,在我将所有内容推送到Heroku后,该应用程序运行良好,但没有任何数据。我不想重新输入海量数据,所以有没有人有任何帮助我的方法?

解决方案

如果你

  heroku运行rake db:seed 
将应用程序推送到heroku,您可以使用以下命令对数据库进行种子处理。


I store all my app's data in seeds.rb locally. However, after I pushing everything to Heroku, the app works well, but without any data. I do not want to re-input the mass data again, so does anyone have any ways to help me?

解决方案

If you push the app to heroku, you can seed the database with the following command.

heroku run rake db:seed

这篇关于如何将seeds.rb推送到现有的Rails应用程序(在Heroku上)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆