yamldb / yaml_db

Rails plugin for a database-independent dump format, data.yml .......... Seeking new maintainers! See https://github.com/yamldb/yaml_db/issues/143
https://rubygems.org/gems/yaml_db
949 stars 200 forks source link

db:data:load encode error #34

Open rc1021 opened 12 years ago

rc1021 commented 12 years ago

Dear All:

I have a posts.yml, like this:

  ---
  posts:
    columns:
    - id
    - status
    - user_id
    - text
    records:
    - - 1
      - 1
      - 3
      - "Hi, every one."
    - - 2
      - 1
      - 3
      - "\u{9019}\u{4ef6}\u{6d0b}\u{88dd}\u{597d}\u{8b9a}\u{ff01}\u{8acb}\u{5927}\u{5bb6}\u{8a55}\u{5206}"

and I did a command to termial:

  rake db:data:load 

she told me

** Invoke db:data:load_dir (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:data:load_dir
rake aborted!
couldn't parse YAML at line 16 column 10
/Users/easter1021/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:148:in `parse'
/Users/easter1021/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:148:in `parse_stream'
/Users/easter1021/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:198:in `load_stream'
/Users/easter1021/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/deprecated.rb:28:in `load_documents'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.2/lib/yaml_db.rb:60:in `load_documents'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.2/lib/serialization_helper.rb:57:in `block in load'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.2/lib/serialization_helper.rb:56:in `load'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.2/lib/serialization_helper.rb:40:in `block in load_from_dir'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.2/lib/serialization_helper.rb:36:in `each'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.2/lib/serialization_helper.rb:36:in `load_from_dir'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.2/lib/tasks/yaml_db_tasks.rake:42:in `block (3 levels) in <top (required)>'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/easter1021/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load'
/Users/easter1021/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `<main>'
Tasks: TOP => db:data:load

I guess error what is encode problem.

how can I do to void this problem? thx all....