postgresql - 将数据库导出到 Heroku 时出现错误

标签 postgresql heroku rubygems taps

我正在尝试将我的 postgres 数据库从 Windows 拉入 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,并且在本地安装了以下 gem:

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

有人能帮忙吗?

谢谢

最佳答案

在搜索和尝试了很多东西之后,我发现我没有添加数据库插件。 (Heroku 声明每个应用程序都带有数据库,所以我不知道我必须激活插件)

一个简单的:

heroku addons:add shared-database

解决了一切。

希望对大家有帮助

关于postgresql - 将数据库导出到 Heroku 时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7840063/

相关文章:

PostgreSQL 按日期和截断时间分组时间戳

node.js - 无法在heroku中的nodejs上发帖

ruby-on-rails - 如何让Redis在Heroku上启动?

ruby-on-rails - 卸载 rails 和 gems,得到错误 "cannot uninstall, check ' gem list -d ...'

ruby - 检查 gem 的系统依赖性

ruby-on-rails - 错误 : Failed to build gem native extension message (Linux) installing rubygems

javascript - 如何使用偏移量在 Sequelize 中正确获取分页结果?

python - AWS Lambda S3 复制到 Postgres 成功但不复制数据

python - 使用 psycopg2 批量插入、返回和更新

ruby-on-rails - Heroku Cedar 上的 Resque 无法正常工作