how can i get data from localhost:3000 in ruby on rails to heroku

32 views
Skip to first unread message

huon sothon

unread,
Jul 7, 2014, 10:21:23 PM7/7/14
to rubyonra...@googlegroups.com
Hi i'm new developer ROR .I have some question to ask?
In my local machine i had input some data into database using SQLite3 .when i deployed it to heroku why i can't get data that i input? i'm do like this

-in Gemfile
group :development do
  gem 'sqlite3'
end
group :production do
  gem 'pg'
  gem 'rails_12factor'
end
-bundle install
-heroku login
-git init
-git add .
-git commit -m "test"
-git create
-git push heroku master
-heroku run rake db:migrate

how can i get some data when i deployed it to heroku? please help me.

Ron H

unread,
Jul 8, 2014, 2:20:43 PM7/8/14
to rubyonra...@googlegroups.com
Because Heroku doesn't use SQLite. It switched to Postgres database in the backend. Try to use Postgres DB in your development and production environments so you can backup your local database and restore it to Heroku database using pgAdminIII. 

Login to Heroku to get database Connection Settings and follow this screenshot to connect to Heroku database using pgAdminIII: http://goo.gl/iClfdm

~Ron 

Hassan Schroeder

unread,
Jul 8, 2014, 2:41:12 PM7/8/14
to rubyonrails-talk
On Tue, Jul 8, 2014 at 11:20 AM, Ron H <swapti...@gmail.com> wrote:
> Because Heroku doesn't use SQLite.

Uh, no. It's because the DB on the OP's development machine has
nothing intrinsically to do with the DB on Heroku :-)

> Try to use Postgres DB in your development and production
> environments so you can backup your local database and restore it to Heroku
> database using pgAdminIII.

Heroku has native functionality to transfer data (`heroku pg:push`
and `heroku pg:pull`) if you're running Postgresql locally.

FWIW,
--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
Reply all
Reply to author
Forward
0 new messages