我正在切换到Heroku托管。我在我的本地机器上有当前生产数据库的副本(> 100 M),我无法将其推送到heroku。
我一遍又一遍地得到同样的错误:
Taps Server Error: undefined method `symbolize_keys' for nil:NilClass
这似乎与数据库中的某些NULL值有关(并非所有)。有想法该怎么解决这个吗?谢谢!
以下是完整输出:
!!! Caught Server Exception
HTTP CODE: 500
Taps Server Error: undefined method `symbolize_keys' for nil:NilClass
/app/lib/taps/data_stream.rb:183:in `parse_json'/app/lib/taps/server.rb:69:in
POST /sessions/:key/push/verify_stream /app/.bundle/gems/ruby/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:863:in
call/app/.bundle/gems/ruby/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:863:in
route /app/.bundle/gems/ruby/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:521:in
instance_eval /app/.bundle/gems/ruby/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:521:in
route_eval /app/.bundle/gems/ruby/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:500:in
route!/app/.bundle/gems/ruby/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:497:in
catch/app/.bundle/gems/ruby/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:497:in
route!/app/.bundle/gems/ruby/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:476:in
each/app/.bundle/gems/ruby/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:476:in
route!/app/.bundle/gems/ruby/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:601:in
dispatch! /app/.bundle/gems/ruby/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:411:in
call! /app/.bundle/gems/ruby/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:566:in
instance_eval /app/.bundle/gems/ruby/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:566:in
invoke/app/.bundle/gems/ruby/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:566:in
catch /app/.bundle/gems/ruby/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:566:in
invoke /app/.bundle/gems/ruby/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:411:in
call!/app/.bundle/gems/ruby/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:399:in
call/app/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/auth/basic.rb:25:in
call /app/.bundle/gems/ruby/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:979:in
call /app/.bundle/gems/ruby/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:1005:in
synchronize/app/.bundle/gems/ruby/1.8/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.8/gems/rack-1.2.1/lib/rack/urlmap.rb:47:in
call'/app/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/urlmap.rb:41:in
each'/app/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/urlmap.rb:41:in
call'/home/heroku_rack/lib/date_header.rb:14:in
call'/app/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:77:in
call'/app/.bundle/gems/ruby/1.8/gems/thin-1.2.7/lib/thin/connection.rb:76:in
pre_process'/app/.bundle/gems/ruby/1.8/gems/thin-1.2.7/lib/thin/connection.rb:74:in
catch'/app/.bundle/gems/ruby/1.8/gems/thin-1.2.7/lib/thin/connection.rb:74:in
pre_process'/app/.bundle/gems/ruby/1.8/gems/thin-1.2.7/lib/thin/connection.rb:57:in
process'/app/.bundle/gems/ruby/1.8/gems/thin-1.2.7/lib/thin/connection.rb:42:in
receive_data'/app/.bundle/gems/ruby/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in
run_machine'/app/.bundle/gems/ruby/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in
run'/app/.bundle/gems/ruby/1.8/gems/thin-1.2.7/lib/thin/backends/base.rb:57:in
start'/app/.bundle/gems/ruby/1.8/gems/thin-1.2.7/lib/thin/server.rb:156:in
start'/app/.bundle/gems/ruby/1.8/gems/thin-1.2.7/lib/thin/controllers/controller.rb:80:in
start'/app/.bundle/gems/ruby/1.8/gems/thin-1.2.7/lib/thin/runner.rb:177:in
send'/app/.bundle/gems/ruby/1.8/gems/thin-1.2.7/lib/thin/runner.rb:177:in
run_command'/app/.bundle/gems/ruby/1.8/gems/thin-1.2.7/lib/thin/runner.rb:143:in
run!'/app/.bundle/gems/ruby/1.8/gems/thin-1.2.7/bin/thin:6/usr/ruby1.8./bin/thin:19:in
load'/usr/ruby1.8.7/bin/thin:19
答案 0 :(得分:4)
Heroku博客对使用水龙头将大数据推送到heroku的策略进行了很好的讨论
要分解作业,请仅按特定表格 heroku db:pull --tables日志,标签
使用崩溃日志文件恢复传输 heroku db:pull --resume-filename session_file.dat
有关详细信息,请参阅:http://blog.heroku.com/archives/2010/4/21/supporting_big_data_part_1/
答案 1 :(得分:0)
当我拼错了表格列的名称时,我遇到了这个错误。例如:
create_table "tags", :force => true do |t|
t.stinrg "name"
end
名称t.stinrg
不正确且应为t.string
。检查所有整数字段。特别是因为你有add_column
因为rails
通常会生成错误的表名,当我add_column
时,我会将其拼错为add_column :tags, :post_count, :integer