Taps error exporting DB to Heroku

921 Views Asked by At

I'm trying to pull my postgres db into Heroku from windows. I run

$app_folder> heroku db:push postgres://postgres:password@localhost/db_name

It sends the schema correctly and some data to the tables but then I got the following error.

19 tables, 1,835 records
    Saving session to push_201110201435.dat..
    !!! Caught Server Exception
    HTTP CODE: 500
    Taps Server Error: LoadError: no such file to load -- sequel/adapters/
    ["/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/core.rb:249:in `req
    uire'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/core.rb:249:
    in `block in tsk_require'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib
    /sequel/core.rb:72:in `block in check_requiring_thread'", "<internal:prelude>:10
    :in `synchronize'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/
    core.rb:69:in `check_requiring_thread'", "/app/.bundle/gems/ruby/1.9.1/gems/sequ
    el-3.20.0/lib/sequel/core.rb:249:in `tsk_require'", "/app/.bundle/gems/ruby/1.9.
    1/gems/sequel-3.20.0/lib/sequel/database/connecting.rb:25:in `adapter_class'", "
    /app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/database/connecting.r
    b:54:in `connect'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/
    core.rb:119:in `connect'", "/app/lib/taps/db_session.rb:14:in `conn'", "/app/lib
    /taps/server.rb:91:in `block in <class:Server>'", "/app/.bundle/gems/ruby/1.9.1/
    gems/sinatra-1.0/lib/sinatra/base.rb:865:in `call'", "/app/.bundle/gems/ruby/1.9
    .1/gems/sinatra-1.0/lib/sinatra/base.rb:865:in `block in route'", "/app/.bundle/
    gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:521:in `instance_eval'", "/
    app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:521:in `route_e
    val'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:500:in
     `block (2 levels) in route!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/l
    ib/sinatra/base.rb:497:in `catch'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1
    .0/lib/sinatra/base.rb:497:in `block in route!'", "/app/.bundle/gems/ruby/1.9.1/
    gems/sinatra-1.0/lib/sinatra/base.rb:476:in `each'", "/app/.bundle/gems/ruby/1.9
    .1/gems/sinatra-1.0/lib/sinatra/base.rb:476:in `route!'", "/app/.bundle/gems/rub
    y/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:601:in `dispatch!'", "/app/.bundle/
    gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:411:in `block in call!'", "
    /app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `instan
    ce_eval'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:56
    6:in `block in invoke'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sina
    tra/base.rb:566:in `catch'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/
    sinatra/base.rb:566:in `invoke'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0
    /lib/sinatra/base.rb:411:in `call!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra
    -1.0/lib/sinatra/base.rb:399:in `call'", "/app/.bundle/gems/ruby/1.9.1/gems/rack
    -1.2.1/lib/rack/auth/basic.rb:25:in `call'", "/app/.bundle/gems/ruby/1.9.1/gems/
    sinatra-1.0/lib/sinatra/base.rb:979:in `block in call'", "/app/.bundle/gems/ruby
    /1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:1005:in `synchronize'", "/app/.bundl
    e/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `call'", "/home/he
    roku_rack/lib/static_assets.rb:9:in `call'", "/home/heroku_rack/lib/last_access.
    rb:15:in `call'", "/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/urlmap.
    rb:47:in `block in call'", "/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rac
    k/urlmap.rb:41:in `each'", "/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rac
    k/urlmap.rb:41:in `call'", "/home/heroku_rack/lib/date_header.rb:14:in `call'",
    "/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:77:in `call'",
     "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:76:in `blo
    ck in pre_process'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/conn
    ection.rb:74:in `catch'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin
    /connection.rb:74:in `pre_process'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2
    .7/lib/thin/connection.rb:57:in `process'", "/app/.bundle/gems/ruby/1.9.1/gems/t
    hin-1.2.7/lib/thin/connection.rb:42:in `receive_data'", "/app/.bundle/gems/ruby/
    1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'", "/app
    /.bundle/gems/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `r
    un'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/backends/base.rb:57
    :in `start'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/server.rb:1
    56:in `start'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/controlle
    rs/controller.rb:80:in `start'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/l
    ib/thin/runner.rb:177:in `run_command'", "/app/.bundle/gems/ruby/1.9.1/gems/thin
    -1.2.7/lib/thin/runner.rb:143:in `run!'", "/app/.bundle/gems/ruby/1.9.1/gems/thi
    n-1.2.7/bin/thin:6:in `<top (required)>'", "/usr/ruby1.9.2/bin/thin:19:in `load'
    ", "/usr/ruby1.9.2/bin/thin:19:in `<main>'"]

As said before I'm running Windows and I have the following gems installed locally:

addressable (2.2.6)
heroku (2.9.0)
launchy (2.0.5)
mime-types (1.16)
minitest (2.6.1, 1.6.0)
pg (0.11.0 x86-mingw32)
rack (1.3.5)
rake (0.9.2, 0.8.7)
rdoc (2.5.8)
rest-client (1.6.7)
rubyzip (0.9.4)
sequel (3.28.0, 3.20.0)
sinatra (1.0)
sqlite3 (1.3.4 x86-mingw32)
sqlite3-ruby (1.3.3)
taps (0.3.23)
term-ansicolor (1.0.7)

I found this thread on Github but it didn't solve my issue: https://github.com/ricardochimal/taps/issues/86

Can anyone help?

Thanks

2

There are 2 best solutions below

0
On BEST ANSWER

A lot of time after searching and trying some things I noticed that I didn't add the database addon. (Heroku states that every application comes with database so I didn't figure out I had to activate the addon)

A simple:

heroku addons:add shared-database

Solved everything.

Hope it helps anyone

0
On

Assuming you've added a database and you're still having this problem make sure you have at least 1 Dyno running and you've promoted your database.

To promote a database, first get the name of it by running:

heroku pg

It will be called something like HEROKU_POSTGRESQL_COLOR_URL, then just promote it:

heroku pg:promote HEROKU_POSTGRESQL_COLOR_URL

This will allow you to access that database via the DATABASE_URL environment variable, which is what the db:push command uses to push to.