我正在使用yaml_db
gem将我的数据库从PHP
/ mySQL
迁移到RoR
/ Postgres
。我运行时输入YAML文件的第1555870行(约4M)出现上述错误:
bundle exec rake db:data:load RAILS_ENV=production
它似乎与行或大小有关 - 我已将其缩小到这一特定行,目前对此有评论:
-
slot_id: '2628865'
sheet_id: '18485'
label: '10:20am to 12:20pm'
name: 'Jim Watson'
email: ''
#bad here - moving "breakrighthere" before this comment throws error related to bad syntax
breakrighthere
-
slot_id: '2628866'
sheet_id: '18485'
label: '2:35pm to 3:05pm'
name: 'Christy Brown'
email: ''
堆栈跟踪:
rake aborted!
Psych::SyntaxError: (<unknown>): control characters are not allowed at 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 by running task with --trace)
有什么想法吗?