2011-10-14 44 views
0

我的MySQL數據庫無法推送到Herokus postgreSQL數據庫。我已經安裝了水龍頭。Heroku無法推送數據庫:Taps服務器錯誤:PGError:錯誤:

這是我的錯誤消息當我嘗試向數據庫發送到Heroku的:

[email protected] /c/rails/funanew (master) 
$ heroku db:push mysql://root:[email protected]/funew 
Loaded Taps v0.3.23 
Warning: Data in the app 'funa' will be overwritten and will not be recoverable. 

! WARNING: Potentially Destructive Action 
! This command will affect the app: funa 
! To proceed, type "funa" or re-run this command with --confirm funa 

> funa 
Sending schema 
Schema:  100% |==========================================| Time: 00:00:22 
Sending indexes 
Sending data 
4 tables, 26 records 
movielimits: 100% |==========================================| Time: 00:00:00 
photographers: 27% |===========        | ETA: 00:00:22 
Saving session to push_201110142326.dat.. 
!!! Caught Server Exception 
HTTP CODE: 500 
Taps Server Error: PGError: ERROR: invalid byte sequence for encoding "UTF8": 0 
xd872 
HINT: This error can also happen if the byte sequence does not match the encodi 
ng expected by the server, which is controlled by "client_encoding". 

["/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/postgres.r 
b:175:in `async_exec'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/seq 
uel/adapters/postgres.rb:175:in `block (2 levels) in execute'", "/app/.bundle/ge 
ms/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/database/logging.rb:28:in `log_yield 
'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/postgre 
s.rb:175:in `block in execute'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20. 
0/lib/sequel/adapters/postgres.rb:158:in `check_disconnect_errors'", "/app/.bund 
le/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:175:in `ex 
ecute'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/po 
stgres.rb:240:in `block (2 levels) in execute'", "/app/.bundle/gems/ruby/1.9.1/g 
ems/sequel-3.20.0/lib/sequel/connection_pool/threaded.rb:71:in `hold'", "/app/.b 
undle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/database/connecting.rb:226:i 
n `synchronize'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/ad 
apters/postgres.rb:240:in `block in execute'", "/app/.bundle/gems/ruby/1.9.1/gem 
s/sequel-3.20.0/lib/sequel/adapters/postgres.rb:261:in `check_database_errors'", 
"/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/postgres.r 
b:238:in `execute'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel 
/database/query.rb:71:in `execute_dui'", "/app/.bundle/gems/ruby/1.9.1/gems/sequ 
el-3.20.0/lib/sequel/dataset/actions.rb:552:in `execute_dui'", "/app/.bundle/gem 
s/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/dataset/actions.rb:243:in `block (2 l 
evels) in import'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/ 
dataset/actions.rb:243:in `each'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.2 
0.0/lib/sequel/dataset/actions.rb:243:in `block in import'", "/app/.bundle/gems/ 
ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/database/query.rb:223:in `_transaction' 
", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/database/query.rb 
:209:in `block in transaction'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20. 
0/lib/sequel/connection_pool/threaded.rb:84:in `hold'", "/app/.bundle/gems/ruby/ 
1.9.1/gems/sequel-3.20.0/lib/sequel/database/connecting.rb:226:in `synchronize'" 
, "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/database/query.rb: 
207:in `transaction'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequ 
el/dataset/actions.rb:243:in `import'", "/app/lib/taps/data_stream.rb:315:in `im 
port_rows'", "/app/lib/taps/data_stream.rb:158:in `fetch_remote_in_server'", "/a 
pp/lib/taps/server.rb:94:in `block (3 levels) in <class:Server>'", "/app/lib/tap 
s/utils.rb:161:in `call'", "/app/lib/taps/utils.rb:161:in `server_error_handling 
'", "/app/lib/taps/server.rb:92:in `block (2 levels) in <class:Server>'", "/app/ 
lib/taps/db_session.rb:15:in `block in conn'", "/app/.bundle/gems/ruby/1.9.1/gem 
s/sequel-3.20.0/lib/sequel/database/connecting.rb:76:in `connect'", "/app/.bundl 
e/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/bas 
e.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_eval'", "/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/lib/sinatra/base.rb:497:in `catch 
'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:497:in `b 
lock in route!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/bas 
e.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/ruby/1.9.1/gems/sinatra-1.0/lib/sin 
atra/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/gem 
s/sinatra-1.0/lib/sinatra/base.rb:566:in `instance_eval'", "/app/.bundle/gems/ru 
by/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `block in invoke'", "/app/. 
bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `catch'", "/a 
pp/.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 `cal 
l!'", "/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/sina 
tra/base.rb:1005:in `synchronize'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1 
.0/lib/sinatra/base.rb:979:in `call'", "/home/heroku_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/rack/urlmap.rb:41:in `each'", "/app 
/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/urlmap.rb:41:in `call'", "/hom 
e/heroku_rack/lib/date_header.rb:14:in `call'", "/app/.bundle/gems/ruby/1.9.1/ge 
ms/rack-1.2.1/lib/rack/builder.rb:77:in `call'", "/app/.bundle/gems/ruby/1.9.1/g 
ems/thin-1.2.7/lib/thin/connection.rb:76:in `block in pre_process'", "/app/.bund 
le/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:74:in `catch'", "/app/ 
.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:74:in `pre_proces 
s'", "/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/thin-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/ev 
entmachine-0.12.10/lib/eventmachine.rb:256:in `run'", "/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:156:in `start'", "/app/.bundle/ge 
ms/ruby/1.9.1/gems/thin-1.2.7/lib/thin/controllers/controller.rb:80:in `start'", 
"/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/runner.rb:177:in `run_co 
mmand'", "/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/thin-1.2.7/bin/thin:6:in `<top (req 
uired)>'", "/usr/ruby1.9.2/bin/thin:19:in `load'", "/usr/ruby1.9.2/bin/thin:19:i 
n `<main>'"] 

[email protected] /c/rails/funanew (master) 
$ 

UPDATE:

當我說的Heroku DB:推在我的git控制檯的根應用程序。我得到這個錯誤:

[email protected] /c/rails/myapp (master) 
$ heroku db:push 
Loaded Taps v0.3.23 
Error parsing database.yml: undefined method `[]' for nil:NilClass 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.3.6/lib/heroku/command/db.rb:72:in 
`parse_database_yml' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.3.6/lib/heroku/command/db.rb:157:in 
`parse_taps_opts' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.3.6/lib/heroku/command/db.rb:29:in 
`push' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.3.6/lib/heroku/command.rb:114:in `r 
un' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.3.6/bin/heroku:14:in `<top (require 
d)>' 
c:/Ruby192/bin/heroku:19:in `load' 
c:/Ruby192/bin/heroku:19:in `<main>' 
Invalid database url 

[email protected] /c/rails/myapp (master) 
$ 

我的config文件夾中的database.yml:

development: 
     adapter: mysql 
     database: [mydatabase] 
     encoding: utf8 
     pool: 5 
     username: root 
     password: mysecretpassword 
     socket: C:/xampp/mysql/bin/mysqld.sock 
     host: localhost 
     encoding: utf8 

    # Warning: The database defined as "test" will be erased and 
    # re-generated from your development database when you run "rake". 
    # Do not set this db to the same as development or production. 
    test: 
     adapter: mysql 
     database: [mydatabase] 
     pool: 5 
     username: root 
     password: mysecretpassword 
     socket: C:/xampp/mysql/bin/mysqld.sock 
     host: localhost 
     encoding: utf8 

    production: 
     adapter: mysql 
     database: [mydatabase] 
     pool: 5 
     username: root 
     password: mysecretpassword 
     socket: C:/xampp/mysql/bin/mysqld.sock 
     host: localhost 
     encoding: utf8 
+0

您的本地MySQL數據庫是否使用UTF-8? –

+0

是的,它應該使用它。數據庫的(排序規則)是:utf8_danish_ci –

+0

當使用heroku db時,我用錯誤日誌更新了我的問題:push代替heroku db:push mysql:// myuser:mypassword @ localhost/mydatabase –

回答

0

字符0xd872,我相信,是不是UTF-8。類似的事情發生了here, also with Heroku

祝你好運。

忘了提及,也許你的編輯器在默認的編碼或字體中沒有特定的字符,並用生氣的問號替換它,並在上傳時拋出錯誤。