My Rails app is about an Online Shopping site. I'm trying Deploy it to Heroku. I've done push to heroku,and rake db:migrate.
But now in the My web,it doesn't have any Data.
In the localhost:3000,I can show Products,Phones,Users,etc. But in my web:https://boiling-bayou-5793.herokuapp.com/welcome/home
It doesn't show anything. So what should I do to upload data from my PC to my web
-
You should see your logs to see if it has any info, see more at devcenter.heroku.com/articles/logging#log-retrievalolahell– olahell2016年01月14日 12:43:26 +00:00Commented Jan 14, 2016 at 12:43
2 Answers 2
The data from your local development database is not automatically transferred to the production environment. There is no rake task to do that.
You can use seed files and the rake db:seed task to get some initial data in your (production) database.
Comments
A more heroku-specific method could be just loading a database dump. Assuming you're using Postgresql, n your local computer do
pg_dump -h localhost -U username -Fc dbname > db.dump
upload the file somewhere on the internet (like Amazon S3 so you can get a direct download link) and then on heroku run
heroku pgbackups:restore SHARED_DATABASE http://www.example.com/db.dump
Remember to remove the db dump right away if it's any kind of sensitive data!