1

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

asked Jan 14, 2016 at 12:34
1

2 Answers 2

3

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.

answered Jan 14, 2016 at 12:42
Sign up to request clarification or add additional context in comments.

Comments

1

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!

answered Jan 14, 2016 at 12:46

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.