ruby - Psych control characters are not allowed at line 1 column 1 -


i using yaml_db gem migrate db php/mysql ror/postgres. getting above error on line 1555870 (of ~4m) of input yaml file when run:

bundle exec rake db:data:load rails_env=production 

it seems line or size dependent - i've narrowed down particular line, has comment on it:

-   slot_id: '2628865'   sheet_id: '18485'   label: '10:20am 12:20pm'   name: 'jim watson'   email: '' #bad here - moving "breakrighthere" before comment throws error related bad syntax breakrighthere -   slot_id: '2628866'   sheet_id: '18485'   label: '2:35pm 3:05pm'   name: 'christy brown'   email: '' 

the stack trace:

rake aborted! psych::syntaxerror: (<unknown>): control characters not allowed @ line 1 column 1 /home/signup/app/releases/11/vendor/bundle/ruby/2.1.0/gems/yaml_db-0.3.0/lib/yaml_db.rb:61:in `load_documents' /home/signup/app/releases/11/vendor/bundle/ruby/2.1.0/gems/yaml_db-0.3.0/lib/serialization_helper.rb:57:in `block in load' /home/signup/app/releases/11/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction' /home/signup/app/releases/11/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/transaction.rb:188:in `within_new_transaction' /home/signup/app/releases/11/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction' /home/signup/app/releases/11/vendor/bundle/ruby/2.1.0/gems/yaml_db-0.3.0/lib/serialization_helper.rb:56:in `load' /home/signup/app/releases/11/vendor/bundle/ruby/2.1.0/gems/yaml_db-0.3.0/lib/serialization_helper.rb:31:in `load' /home/signup/app/releases/11/vendor/bundle/ruby/2.1.0/gems/yaml_db-0.3.0/lib/tasks/yaml_db_tasks.rake:35:in `block (3 levels) in <top (required)>' tasks: top => db:data:load (see full trace running task --trace) 

any ideas?

the error misleading, example give incorrect yaml, , should throw error in parser. can check when feeding text, with or without comment, in online parser (python based).

the problem there should dash @ beginning of unindented line (if dashes not @ beginning of lines alternatively outdent finish sequence in block style).


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -