2011-10-20 20 views
4

我想從Windows中將我的postgres數據庫拉到Heroku。我跑水龍頭錯誤導出數據庫到Heroku

$app_folder> heroku db:push postgres://postgres:[email protected]/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

任何人都可以幫忙嗎?

感謝

回答

6

很多時間尋找和嘗試一些事情,我注意到,我沒有添加數據庫插件後。 (Heroku的規定,每個應用程序自帶的數據庫,所以我也沒弄明白,我不得不激活插件)

簡單:

heroku addons:add shared-database 

解決一切。

希望它可以幫助任何人

1

假設你已經添加了一個數據庫,你仍然有這個問題,請確保你至少有1測功機的運行,你已經提升你的數據庫。

促進數據庫,首先運行得到它的名字:

heroku pg 

它將被稱爲像HEROKU_POSTGRESQL_COLOR_URL,然後只是推廣它:

heroku pg:promote HEROKU_POSTGRESQL_COLOR_URL 

這將允許你通過DATABASE_URL環境變量訪問該數據庫,這是db:push命令用於推送的內容。