点击错误导出DB到Heroku

时间:2011-10-20 17:53:23

标签: postgresql heroku gem taps

我正试图从Windows中将我的postgres数据库拉入Heroku。我跑

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

它正确地将模式和一些数据发送到表,但后来我收到了以下错误。

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>'"]

如前所述,我正在运行Windows,我在本地安装了以下宝石:

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)

我在Github上找到了这个帖子,但它没有解决我的问题:https://github.com/ricardochimal/taps/issues/86

有人可以帮忙吗?

由于

2 个答案:

答案 0 :(得分:6)

在搜索和尝试一些事情后很多时候我注意到我没有添加数据库插件。 (Heroku说每个应用程序都带有数据库,所以我没想到我必须激活插件)

简单:

heroku addons:add shared-database

解决了一切。

希望它可以帮助任何人

答案 1 :(得分:1)

假设您已经添加了一个数据库并且仍然遇到此问题,请确保您至少运行了1个Dyno,并且您已经升级了数据库。

要宣传数据库,请先运行以下命令获取其名称:

heroku pg

它会被称为HEROKU_POSTGRESQL_COLOR_URL,然后只是宣传它:

heroku pg:promote HEROKU_POSTGRESQL_COLOR_URL

这将允许您通过DATABASE_URL环境变量访问该数据库,这是db:push命令用来推送到的。