GithubHelp home page GithubHelp logo

yamldb / yaml_db Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adamwiggins/yaml_db

949.0 949.0 199.0 130 KB

Rails plugin for a database-independent dump format, data.yml .......... Seeking new maintainers! See https://github.com/yamldb/yaml_db/issues/143

Home Page: https://rubygems.org/gems/yaml_db

Ruby 100.00%

yaml_db's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yaml_db's Issues

Still being maintained?

Is this project still being maintained? The last few issues have received no responses. There have been multiple attempts to add single table support that have fizzled with responses of "needs cleanup" but too general for the author to improve upon. What is the current state of the project?

yaml_db 0.2.1 incompatible with YAML engine 'psych'

Hello,
I use Mac OS X to develop and deploy on Linux. On my machine, there is no libyaml installed thus Ruby uses 'syck' as a yaml engine, but on Linux, it uses 'psyck' because libyaml is present.

yaml_db works perfectly with 'syck' but I noticed it fails with 'psyck' for me.

Dumping with yaml_db
psych:

- - 2
  - ! '40, Obama road , #04-03  Building'
  - Singapore
  - 234332
  - SG
  - !!null

syck:

  - - 2
    - "40, Obama road , #04-03  Building"
    - Singapore
    - 577185
    - SG
    -

Loading
yaml_db doesn't complain while dumping but those difference make yaml_db:load fail.

 You have a nil object when you didn't expect it!
 You might have expected an instance of Array.
 The error occurred while evaluating nil.each
 /usr/local/rvm/gems/ruby-1.9.2-p180/gems/yaml_db-0.2.1/lib/serialization_helper.rb:85:in `load_records'

it's easily reproducible (ruby 1.9.2 / rails 3.0.7):

rvm package install libyaml
rvm remove 1.9.2
rvm install 1.9.2
rails new my_app
cd my_app
rails g scaffold users name:string role:string
rake db:migrate
rake db:fixtures:load
rake db:dump 
rake db:load

`
Solution
Could force the parser to use syck: YAML::ENGINE.yamler= 'syck'
but if user has selected his parser, this might erase his setting. Is there a way to backup user parser to put it back in place? If there is an exception is it bad?

http://stackoverflow.com/questions/4980877/rails-error-couldnt-parse-yaml

Dumping empty tables doesn't empty them when loading

It appears that yaml_db doesn't dump empty tables, which means that it doesn't know to truncate them when loading. This was definitely unexpected. It is fairly easy to resolve, but before I create a pull request (including extending the test suite to validate the behavior), I'd like to know if there's a consensus that this behavior should be changed. In case anyone else wants my monkey-patch in the interim, here is my monkey patch for 0.2.3:

module SerializationHelper
  class Load
    def self.load_records(table, column_names, records)
      if column_names.nil?
        return
      end
      columns = column_names.map{|cn| ActiveRecord::Base.connection.columns(table).detect{|c| c.name == cn}}
      quoted_column_names = column_names.map { |column| ActiveRecord::Base.connection.quote_column_name(column) }.join(',')
      quoted_table_name = SerializationHelper::Utils.quote_table(table)
      (records || []).each do |record|
        quoted_values = record.zip(columns).map{|c| ActiveRecord::Base.connection.quote(c.first, c.last)}.join(',')
        ActiveRecord::Base.connection.execute("INSERT INTO #{quoted_table_name} (#{quoted_column_names}) VALUES (#{quoted_values})")
      end
    end
  end

  class Dump
    def self.dump_table(io, table)
      dump_table_columns(io, table)
      dump_table_records(io, table)
    end
  end
end

The modification to SerializationHelper::Load::load_records is to substitute an empty array for records if the latter is missing. The modification to SerializationHelper::Dump.dump_table is to eliminate the first line that returns if the table has no records.

db:data:load encode error

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....

TypeError: wrong argument type Arel::SelectManager (expected String)

I'm getting the above error on a normal rake db:data:dump, our app is

Ruby 1.9.3-p125
Rails 3.0.9
Yaml_db 0.2.3

Switching back to yaml_db 0.2.2 worked fine. Here's the trace

** Invoke db:data:dump (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:data:dump
rake aborted!
TypeError: wrong argument type Arel::SelectManager (expected String): #Arel::SelectManager:0x00000005d5c370
/home/swearwords/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract_adapter.rb:207:in rescue in log' /home/swearwords/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract_adapter.rb:199:inlog'
/home/swearwords/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.0.9/lib/active_record/connection_adapters/postgresql_adapter.rb:514:in execute' /home/swearwords/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.0.9/lib/active_record/connection_adapters/postgresql_adapter.rb:1004:inselect_raw'
/home/swearwords/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.0.9/lib/active_record/connection_adapters/postgresql_adapter.rb:997:in select' /home/swearwords/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/database_statements.rb:7:inselect_all'
/home/swearwords/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/query_cache.rb:56:in select_all' /home/swearwords/.rvm/gems/ruby-1.9.3-p125/gems/yaml_db-0.2.3/lib/serialization_helper.rb:185:inblock in each_table_page'
/home/swearwords/.rvm/gems/ruby-1.9.3-p125/gems/yaml_db-0.2.3/lib/serialization_helper.rb:183:in each' /home/swearwords/.rvm/gems/ruby-1.9.3-p125/gems/yaml_db-0.2.3/lib/serialization_helper.rb:183:ineach_table_page'
/home/swearwords/.rvm/gems/ruby-1.9.3-p125/gems/yaml_db-0.2.3/lib/yaml_db.rb:46:in dump_table_records' /home/swearwords/.rvm/gems/ruby-1.9.3-p125/gems/yaml_db-0.2.3/lib/serialization_helper.rb:168:indump_table'
/home/swearwords/.rvm/gems/ruby-1.9.3-p125/gems/yaml_db-0.2.3/lib/serialization_helper.rb:151:in block in dump' /home/swearwords/.rvm/gems/ruby-1.9.3-p125/gems/yaml_db-0.2.3/lib/serialization_helper.rb:149:ineach'
/home/swearwords/.rvm/gems/ruby-1.9.3-p125/gems/yaml_db-0.2.3/lib/serialization_helper.rb:149:in dump' /home/swearwords/.rvm/gems/ruby-1.9.3-p125/gems/yaml_db-0.2.3/lib/serialization_helper.rb:14:indump'
/home/swearwords/.rvm/gems/ruby-1.9.3-p125/gems/yaml_db-0.2.3/lib/tasks/yaml_db_tasks.rake:21:in block (3 levels) in <top (required)>' /home/swearwords/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:incall'
/home/swearwords/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in block in execute' /home/swearwords/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:ineach'
/home/swearwords/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in execute' /home/swearwords/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/task.rb:158:inblock in invoke_with_call_chain'
/home/swearwords/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/monitor.rb:211:in mon_synchronize' /home/swearwords/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:ininvoke_with_call_chain'
/home/swearwords/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in invoke' /home/swearwords/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/application.rb:116:ininvoke_task'
/home/swearwords/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in block (2 levels) in top_level' /home/swearwords/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:ineach'
/home/swearwords/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in block in top_level' /home/swearwords/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:instandard_exception_handling'
/home/swearwords/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in top_level' /home/swearwords/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/application.rb:66:inblock in run'
/home/swearwords/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in standard_exception_handling' /home/swearwords/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/application.rb:63:inrun'
/home/swearwords/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/bin/rake:33:in <top (required)>' /home/swearwords/.rvm/gems/ruby-1.9.3-p125@global/bin/rake:19:inload'
/home/swearwords/.rvm/gems/ruby-1.9.3-p125@global/bin/rake:19:in `

'
Tasks: TOP => db:data:dump

Issues with truncate_table when using referential integrity and transactions in PostgreSQL

I ran into some issues with the behavior of SerializationHelper::Load.truncate_table when using yaml_db on a PostgreSQL database that had referential integrity. In order to assist in resolving the referential integrity issues, I needed to add CASCADE to the TRUNCATE statement. In order to get the rescue block to work within a transaction, I had to add SAVEPOINT and ROLLBACK statements. My monkey-patch only works for PostgreSQL, and may not work if you're not within a transaction, so getting this ready for inclusion into the actual code base would require adding database-specific support to yaml_db as well as transaction detection logic. I'd be happy to work on a pull request, but before I do I'd like to see some consensus on the desirability of resolving this issue and some discussion of approaches (should I embed the database-specific code in truncate_table or should I enable more generic support for database-specific code across the code base).

Here's my monkey-patch:

module SerializationHelper
  class Load
    def self.truncate_table(table)
      begin
        ActiveRecord::Base.connection.execute("SAVEPOINT before_truncation")
        ActiveRecord::Base.connection.execute("TRUNCATE #{SerializationHelper::Utils.quote_table(table)} CASCADE")
      rescue Exception
        ActiveRecord::Base.connection.execute("ROLLBACK TO SAVEPOINT before_truncation")
        ActiveRecord::Base.connection.execute("DELETE FROM #{SerializationHelper::Utils.quote_table(table)}")
      end
    end
  end
end

Foreign key constraints

When using foreign key constraints (for example when using foreign_key_migrations or redhillonrails) in your database, 'rake db:load' may fail due to the fact that a load order is required when truncating or loading tables. This may result in errors like this (postgres):

PGError: ERROR: current transaction is aborted, commands ignored until end 
of transaction block 
: DELETE FROM schema_info 

I don't know if there's a way to temporarily disable foreign key migrations in postgres (maybe 'SET CONSTRAINTS ALL DEFERRED' could work), but nonetheless this issue might help others experiencing the same problem.

Dump/load doesn't work with JRuby 1.6.8

If I'm trying to load a dump with yaml_db, I see following message:

โžœ rake db:data:dump && rake db:data:load --trace
** Invoke db:data:load (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:data:load
rake aborted!
/home/ytaras/projects/RLM/perforce/brpm/hotfix/2.6-D/Portal/db/data.yml: couldn't parse YAML at line 16 column 2
org/jruby/ext/psych/PsychParser.java:270:in `parse'
/home/ytaras/.rvm/rubies/jruby-1.6.8/lib/ruby/1.9/psych.rb:148:in `parse_stream'
/home/ytaras/.rvm/rubies/jruby-1.6.8/lib/ruby/1.9/psych.rb:198:in `load_stream'
/home/ytaras/.rvm/rubies/jruby-1.6.8/lib/ruby/1.9/psych/deprecated.rb:28:in `load_documents'
/home/ytaras/.rvm/gems/jruby-1.6.8/gems/yaml_db-0.2.3/lib/yaml_db.rb:60:in `load_documents'
/home/ytaras/.rvm/gems/jruby-1.6.8/gems/yaml_db-0.2.3/lib/serialization_helper.rb:57:in `load'
/home/ytaras/.rvm/gems/jruby-1.6.8/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/home/ytaras/.rvm/gems/jruby-1.6.8/gems/yaml_db-0.2.3/lib/serialization_helper.rb:56:in `load'
/home/ytaras/.rvm/gems/jruby-1.6.8/gems/yaml_db-0.2.3/lib/serialization_helper.rb:31:in `load'
/home/ytaras/.rvm/gems/jruby-1.6.8/gems/yaml_db-0.2.3/lib/tasks/yaml_db_tasks.rake:35:in `(root)'
org/jruby/RubyProc.java:258:in `call'
/home/ytaras/.rvm/gems/jruby-1.6.8@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute'
org/jruby/RubyArray.java:1620:in `each'
/home/ytaras/.rvm/gems/jruby-1.6.8@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/home/ytaras/.rvm/gems/jruby-1.6.8@global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/home/ytaras/.rvm/rubies/jruby-1.6.8/lib/ruby/1.9/monitor.rb:201:in `mon_synchronize'
/home/ytaras/.rvm/gems/jruby-1.6.8@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/ytaras/.rvm/gems/jruby-1.6.8@global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/home/ytaras/.rvm/gems/jruby-1.6.8@global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/home/ytaras/.rvm/gems/jruby-1.6.8@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
org/jruby/RubyArray.java:1620:in `each'
/home/ytaras/.rvm/gems/jruby-1.6.8@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/home/ytaras/.rvm/gems/jruby-1.6.8@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/ytaras/.rvm/gems/jruby-1.6.8@global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/home/ytaras/.rvm/gems/jruby-1.6.8@global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `run'
/home/ytaras/.rvm/gems/jruby-1.6.8@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/ytaras/.rvm/gems/jruby-1.6.8@global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/home/ytaras/.rvm/gems/jruby-1.6.8@global/gems/rake-0.9.2.2/bin/rake:33:in `(root)'
org/jruby/RubyKernel.java:1097:in `load'
/home/ytaras/.rvm/gems/jruby-1.6.8@global/gems/rake-0.9.2.2/bin/rake:19:in `'
org/jruby/RubyKernel.java:1117:in `eval'
/home/ytaras/.rvm/gems/jruby-1.6.8/bin/ruby_noexec_wrapper:14:in `(root)'
Tasks: TOP => db:data:load
โžœ ruby -v
jruby 1.6.8 (ruby-1.9.2-p312) (2012-09-18 1772b40) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_32) [linux-amd64-java]

Here's the beginning of a file:

โžœ head db/data.yml -n 16

---
activity_attributes:
  columns:
  - id
  - name
  - required
  - input_type
  - attribute_values
  - created_at
  - updated_at
  - from_system
  - type
  - field
  - list_id
...

Looks like psych doesn't understand three dots (...) sequence - and I'm not able to switch to sych as it's not supported in JRuby 1.6.8, 1.9 source mode.

rake aborted: expected SCALAR, SEQUENCE-START, MAPPING-START, or ALIAS

I'm getting this error using activerecord-sqlserver-adapter.

app> $ RAILS_ENV=production rake db:data:dump --trace
** Invoke db:data:dump (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:data:dump
rake aborted!
expected SCALAR, SEQUENCE-START, MAPPING-START, or ALIAS
/usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:24:in `scalar'
/usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:24:in `visit_Psych_Nodes_Scalar'
/usr/lib/ruby/1.9.1/psych/visitors/visitor.rb:15:in `visit'
/usr/lib/ruby/1.9.1/psych/visitors/visitor.rb:5:in `accept'
/usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:29:in `block in visit_Psych_Nodes_Sequence'
/usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:29:in `each'
/usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:29:in `visit_Psych_Nodes_Sequence'
/usr/lib/ruby/1.9.1/psych/visitors/visitor.rb:15:in `visit'
/usr/lib/ruby/1.9.1/psych/visitors/visitor.rb:5:in `accept'
/usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:29:in `block in visit_Psych_Nodes_Sequence'
/usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:29:in `each'
/usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:29:in `visit_Psych_Nodes_Sequence'
/usr/lib/ruby/1.9.1/psych/visitors/visitor.rb:15:in `visit'
/usr/lib/ruby/1.9.1/psych/visitors/visitor.rb:5:in `accept'
/usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:29:in `block in visit_Psych_Nodes_Sequence'
/usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:29:in `each'
/usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:29:in `visit_Psych_Nodes_Sequence'
/usr/lib/ruby/1.9.1/psych/visitors/visitor.rb:15:in `visit'
/usr/lib/ruby/1.9.1/psych/visitors/visitor.rb:5:in `accept'
/usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:19:in `block in visit_Psych_Nodes_Document'
/usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:19:in `each'
/usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:19:in `visit_Psych_Nodes_Document'
/usr/lib/ruby/1.9.1/psych/visitors/visitor.rb:15:in `visit'
/usr/lib/ruby/1.9.1/psych/visitors/visitor.rb:5:in `accept'
/usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:13:in `block in visit_Psych_Nodes_Stream'
/usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:13:in `each'
/usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:13:in `visit_Psych_Nodes_Stream'
/usr/lib/ruby/1.9.1/psych/visitors/visitor.rb:15:in `visit'
/usr/lib/ruby/1.9.1/psych/visitors/visitor.rb:5:in `accept'
/usr/lib/ruby/1.9.1/psych/nodes/node.rb:46:in `to_yaml'
/usr/lib/ruby/1.9.1/psych.rb:190:in `dump'
/usr/lib/ruby/1.9.1/psych/core_ext.rb:14:in `psych_to_yaml'
/var/lib/gems/1.9.1/gems/yaml_db-0.3.0/lib/yaml_db.rb:27:in `chunk_records'
/var/lib/gems/1.9.1/gems/yaml_db-0.3.0/lib/yaml_db.rb:49:in `block in dump_table_records'
/var/lib/gems/1.9.1/gems/yaml_db-0.3.0/lib/serialization_helper.rb:186:in `block in each_table_page'
/var/lib/gems/1.9.1/gems/yaml_db-0.3.0/lib/serialization_helper.rb:182:in `each'
/var/lib/gems/1.9.1/gems/yaml_db-0.3.0/lib/serialization_helper.rb:182:in `each_table_page'
/var/lib/gems/1.9.1/gems/yaml_db-0.3.0/lib/yaml_db.rb:47:in `dump_table_records'
/var/lib/gems/1.9.1/gems/yaml_db-0.3.0/lib/serialization_helper.rb:167:in `dump_table'
/var/lib/gems/1.9.1/gems/yaml_db-0.3.0/lib/serialization_helper.rb:150:in `block in dump'
/var/lib/gems/1.9.1/gems/yaml_db-0.3.0/lib/serialization_helper.rb:148:in `each'
/var/lib/gems/1.9.1/gems/yaml_db-0.3.0/lib/serialization_helper.rb:148:in `dump'
/var/lib/gems/1.9.1/gems/yaml_db-0.3.0/lib/serialization_helper.rb:14:in `dump'
/var/lib/gems/1.9.1/gems/yaml_db-0.3.0/lib/tasks/yaml_db_tasks.rake:21:in `block (3 levels) in '
/var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/usr/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/var/lib/gems/1.9.1/gems/rake-10.4.2/bin/rake:33:in `'
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19:in `'
Tasks: TOP => db:data:dump

Some info about my environment :

# bundle show
Gems included by the bundle:
  * actionmailer (3.2.22)
  * actionpack (3.2.22)
  * activemodel (3.2.22)
  * activerecord (3.2.22)
  * activerecord-sqlserver-adapter (3.2.13)
  * activeresource (3.2.22)
  * activesupport (3.2.22)
  * arel (3.0.3)
  * builder (3.0.4)
  * bundler (1.3.5)
  * coderay (1.1.0)
  * erubis (2.7.0)
  * hike (1.2.3)
  * i18n (0.6.11)
  * journey (1.0.4)
  * jquery-rails (3.1.3)
  * json (1.8.3)
  * mail (2.5.4)
  * mime-types (1.25.1)
  * multi_json (1.11.2)
  * net-ldap (0.3.1)
  * polyglot (0.3.5)
  * rack (1.4.7)
  * rack-cache (1.2)
  * rack-openid (1.4.2)
  * rack-ssl (1.3.4)
  * rack-test (0.6.3)
  * rails (3.2.22)
  * railties (3.2.22)
  * rake (10.4.2)
  * rbpdf (1.18.6)
  * rdoc (3.12.2)
  * redcarpet (2.3.0)
  * request_store (1.0.5)
  * rmagick (2.13.4)
  * ruby-openid (2.3.0)
  * sprockets (2.2.3)
  * thor (0.19.1)
  * tilt (1.4.1)
  * tiny_tds (0.6.2)
  * treetop (1.4.15)
  * tzinfo (0.3.44)
  * yaml_db (0.3.0)
# ruby --version
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]

Wrongly inserting '---' characters

I'm trying to convert from SQLite3 to MySQL.

As per the instructions in the readme, I ran rake db:dump and created a data.yml file which looked like it had everything in it.

I updated my database.yml to access MySQL and created the dev and test databases.

Running rake db:load successfully created the schema in the dev database, but I received an error when the script started trying to load in the data:

You have a nil object when you didn't expect it!
You might have expected an instance of Array.

Doing some debugging of the script revealed that data['records'] was not finding anything in the data.yml file. When I commented out the three hyphens --- after the word "records" for each table in the file, all the data was successfully loaded.

In other words, the following excerpt from my YAML file worked:

slugs:
columns:

  • id
  • name
  • sluggable_id
  • sequence
  • sluggable_type
  • scope
  • created_at
  • locale
    records:
    #---
  • - 1
    • home
    • 1
    • 1
    • Page
    • !!null
    • '2011-04-25 23:33:22.554123'
    • en

Worked.

There was no binary data in my very small, non-customised refinery CMS database.

undefined method `[]=' for #<ActiveRecord::Result:0x47bb570>

Trying to do a dump and this is what I am getting

C:\Development\rails\automation_metrics_tool>rake db:data:dump --trace
** Invoke db:data:dump (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:data:dump
rake aborted!
undefined method []=' for #<ActiveRecord::Result:0x47bb570> C:/Ruby200/lib/ruby/gems/2.0.0/gems/yaml_db-0.2.3/lib/serialization_helper.rb:10 8:inblock in unhash_records'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.1.0.rc1/lib/active_record/res
ult.rb:55:in block in each' C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.1.0.rc1/lib/active_record/res ult.rb:55:ineach'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.1.0.rc1/lib/active_record/res
ult.rb:55:in each' C:/Ruby200/lib/ruby/gems/2.0.0/gems/yaml_db-0.2.3/lib/serialization_helper.rb:10 7:ineach_with_index'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/yaml_db-0.2.3/lib/serialization_helper.rb:10
7:in unhash_records' C:/Ruby200/lib/ruby/gems/2.0.0/gems/yaml_db-0.2.3/lib/yaml_db.rb:47:inblock in
dump_table_records'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/yaml_db-0.2.3/lib/serialization_helper.rb:18
7:in block in each_table_page' C:/Ruby200/lib/ruby/gems/2.0.0/gems/yaml_db-0.2.3/lib/serialization_helper.rb:18 3:ineach'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/yaml_db-0.2.3/lib/serialization_helper.rb:18
3:in each_table_page' C:/Ruby200/lib/ruby/gems/2.0.0/gems/yaml_db-0.2.3/lib/yaml_db.rb:46:indump_tab
le_records'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/yaml_db-0.2.3/lib/serialization_helper.rb:16
8:in dump_table' C:/Ruby200/lib/ruby/gems/2.0.0/gems/yaml_db-0.2.3/lib/serialization_helper.rb:15 1:inblock in dump'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/yaml_db-0.2.3/lib/serialization_helper.rb:14
9:in each' C:/Ruby200/lib/ruby/gems/2.0.0/gems/yaml_db-0.2.3/lib/serialization_helper.rb:14 9:indump'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/yaml_db-0.2.3/lib/serialization_helper.rb:14
:in dump' C:/Ruby200/lib/ruby/gems/2.0.0/gems/yaml_db-0.2.3/lib/tasks/yaml_db_tasks.rake:2 1:inblock (3 levels) in <top (required)>'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:236:in call' C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:236:inblock i
n execute'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:231:in each' C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:231:inexecute
'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:175:in block i n invoke_with_call_chain' C:/Ruby200/lib/ruby/2.0.0/monitor.rb:211:inmon_synchronize'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:168:in invoke_ with_call_chain' C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/task.rb:161:ininvoke'

C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:149:in invoke_task' C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:106:in
block (2 levels) in top_level'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:106:in each' C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:106:in
block in top_level'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:115:in run_with_threads' C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:100:in
top_level'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:78:in b lock in run' C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:165:in
standard_exception_handling'

Can't use branch for Rails 2

I've downloaded the rails 2 branch into the plugin directory but the following error is shown:

 rake db:data:dump
(in /home/jfong/biorails/enterprise/trunk)
Configuring for Native RUBY
Compound Plugin: Biorails Demo Compound Inventory
rake aborted!
no such file to load -- rails/railtie
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- rails/railtie (MissingSourceFile)
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require'
    from /home/jfong/biorails/enterprise/trunk/vendor/gems/polyglot-0.3.1/lib/polyglot.rb:64:in `require'
    from /home/jfong/biorails/enterprise/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:182:in `require'
    from /home/jfong/biorails/enterprise/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:547:in `new_constants_in'
    from /home/../trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:182:in `require'
    from /home/../trunk/vendor/plugins/yaml_db/lib/yaml_db.rb:6
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require'
    from /home/../trunk/vendor/gems/polyglot-0.3.1/lib/polyglot.rb:64:in `require'
    from /home/../trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:182:in `require'
    from /home../trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:547:in `new_constants_in'
    from /home/../trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:182:in `require'
    from /home/../trunk/vendor/plugins/yaml_db/init.rb:1:in `evaluate_init_rb'
    from /home../trunk/config/../vendor/rails/railties/lib/rails/plugin.rb:158:in `evaluate_init_rb'
    from /home../trunk/vendor/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
    from /home././trunk/config/../vendor/rails/railties/lib/rails/plugin.rb:154:in `evaluate_init_rb'
    from /home../trunk/config/../vendor/rails/railties/lib/rails/plugin.rb:48:in `load'
    from /home/../trunk/config/../vendor/rails/railties/lib/rails/plugin/loader.rb:38:in `load_plugins'
    from /home/../trunk/config/../vendor/rails/railties/lib/rails/plugin/loader.rb:37:in `each'
    from /home/../trunk/config/../vendor/rails/railties/lib/rails/plugin/loader.rb:37:in `load_plugins'
    from /home/../trunk/config/../vendor/rails/railties/lib/initializer.rb:369:in `load_plugins'
    from /home/../trunk/config/../vendor/rails/railties/lib/initializer.rb:165:in `process'
    from /home/../trunk/config/../vendor/rails/railties/lib/initializer.rb:113:in `send'
    from /home/../trunk/config/../vendor/rails/railties/lib/initializer.rb:113:in `run'
    from /home/../trunk/config/environment.rb:27
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /home/../vendor/rails/railties/lib/commands/about.rb:1
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from script/about:4

I'm using Rails 2.3.9

About your application's environment
Ruby version              1.8.7 (i486-linux)
RubyGems version          1.3.7
Rack version              1.1
Rails version             2.3.9
Active Record version     2.3.9
Active Resource version   2.3.9
Action Mailer version     2.3.9
Active Support version    2.3.9
Edge Rails revision       b492d494214a17f0050222ac724a65c8d0881805
Environment               development
Database adapter          mysql

I have also tried to use the master as a plugin as some of the commits mentioned that it can be used as a plugin in Rails 2, but both gave me the same error. Is it something obvious that I'm missing?

NameError: undefined local variable or method `config' for main:Object

When I try to dump out my MySQL database, I get the following error:

NameError: undefined local variable or method `config' for main:Object
/Users/ykravchenko/Projects/appsec/config/application.rb:9:in `<top (required)>'
/Users/ykravchenko/Projects/appsec/Rakefile:4:in `require'
/Users/ykravchenko/Projects/appsec/Rakefile:4:in `<top (required)>'
/Users/ykravchenko/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/rake_module.rb:28:in `load'
/Users/ykravchenko/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/rake_module.rb:28:in `load_rakefile'
/Users/ykravchenko/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/application.rb:687:in `raw_load_rakefile'
/Users/ykravchenko/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/application.rb:94:in `block in load_rakefile'
/Users/ykravchenko/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/Users/ykravchenko/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/application.rb:93:in `load_rakefile'
/Users/ykravchenko/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/application.rb:77:in `block in run'
/Users/ykravchenko/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/Users/ykravchenko/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'
/Users/ykravchenko/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/bin/rake:33:in `<top (required)>'
/Users/ykravchenko/.rvm/gems/ruby-2.1.1/bin/rake:23:in `load'
/Users/ykravchenko/.rvm/gems/ruby-2.1.1/bin/rake:23:in `<main>'
/Users/ykravchenko/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
/Users/ykravchenko/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'

Nil.each

Hey

I am trying to migrate for n postgres database to mysql.
When I run rake db:dump everything works.
When I run rake db:load it gives me an nil.each error.
I know I have empty tables, can you advise what I need to do.

Thanks

add_limit_offset! error in SQLite3

I run:

rake db:data:dump with:
ruby 1.9.3
rails ('3.2.3)
yaml_db (0.2.2)
sqlite3 (1.3.6) .

I get:

undefined method `add_limit_offset!' for #ActiveRecord::ConnectionAdapters::SQLite3Adapter:0xb5b4a40

home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/yaml_db-0.2.2/lib/serialization_helper.rb:184:in block in each_table_page' /home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/yaml_db-0.2.2/lib/serialization_helper.rb:183:ineach'
/home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/yaml_db-0.2.2/lib/serialization_helper.rb:183:in each_table_page' /home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/yaml_db-0.2.2/lib/yaml_db.rb:46:indump_table_records'
/home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/yaml_db-0.2.2/lib/serialization_helper.rb:168:in dump_table' /home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/yaml_db-0.2.2/lib/serialization_helper.rb:151:inblock in dump'
/home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/yaml_db-0.2.2/lib/serialization_helper.rb:149:in each' /home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/yaml_db-0.2.2/lib/serialization_helper.rb:149:indump'
/home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/yaml_db-0.2.2/lib/serialization_helper.rb:14:in dump' /home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/yaml_db-0.2.2/lib/tasks/yaml_db_tasks.rake:21:inblock (3 levels) in <top (required)>'
/home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/rake-0.9.2.2/lib/rake/task.rb:205:in call' /home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/rake-0.9.2.2/lib/rake/task.rb:205:inblock in execute'
/home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/rake-0.9.2.2/lib/rake/task.rb:200:in each' /home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/rake-0.9.2.2/lib/rake/task.rb:200:inexecute'
/home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/rake-0.9.2.2/lib/rake/task.rb:158:in block in invoke_with_call_chain' /home/matias/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211:inmon_synchronize'
/home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/rake-0.9.2.2/lib/rake/task.rb:151:in invoke_with_call_chain' /home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/rake-0.9.2.2/lib/rake/task.rb:144:ininvoke'
/home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/rake-0.9.2.2/lib/rake/application.rb:116:in invoke_task' /home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/rake-0.9.2.2/lib/rake/application.rb:94:inblock (2 levels) in top_level'
/home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/rake-0.9.2.2/lib/rake/application.rb:94:in each' /home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/rake-0.9.2.2/lib/rake/application.rb:94:inblock in top_level'
/home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/rake-0.9.2.2/lib/rake/application.rb:133:in standard_exception_handling' /home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/rake-0.9.2.2/lib/rake/application.rb:88:intop_level'
/home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/rake-0.9.2.2/lib/rake/application.rb:66:in block in run' /home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/rake-0.9.2.2/lib/rake/application.rb:133:instandard_exception_handling'
/home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/rake-0.9.2.2/lib/rake/application.rb:63:in run' /home/matias/.rvm/gems/ruby-1.9.3-p0@wow/gems/rake-0.9.2.2/bin/rake:33:in<top (required)>'
/home/matias/.rvm/gems/ruby-1.9.3-p0@wow/bin/rake:19:in load' /home/matias/.rvm/gems/ruby-1.9.3-p0@wow/bin/rake:19:in

'

multibyte characters get turned into garbled text(ex: ???)

I tried using yaml_db to migrate data from sqlite to mysql, after performing:

  1. rake db:dump

  2. edit config/database.yml - change adapter to mysql2

  3. rake db:load

every character that was a multibyte utf8 character in the original database got turned into question mark symbols(????)

Why not create a new gem?

The user of most advanced fork could create a new gem, this way it will keep the user merits, like what happened with gem cancan (ryanb/cancan#994) and this way we can continue contributing.

@onesup I've used onesup/yaml_db with Rails 4.0.5 with success:

gem 'yaml_db', git: 'git://github.com/onesup/yaml_db.git'

Thanks.

Rails 2.3.8 deprecation warning

Rails 2.3.8 gives this:

DEPRECATION WARNING: Rake tasks in vendor/plugins/yaml_db/tasks are deprecated. Use lib/tasks instead. (called from <top (required)> at ***/gems/rails-2.3.8/lib/tasks/rails.rb:10)

Also, are we rails 3 compatible yet?

UUIDTools::UUID serializing to binary

There is a related issue at jashmenn/activeuuid#70 - but as of yet I haven't received any advice on that on that end.

ActiveUUID provides a binary(16) field for databases that don't natively support UUIDs. In my case, MySQL. I'm trying to port to PostgreSQL, which does have support for UUIDs.

When a record looks like this:

#<TagWork id: #<UUID:0x3256dd8 UUID:00110954-44a5-4ce2-b067-3cf26a9ea631>, tag_id: #<UUID:0x3256824 UUID:a8bcfc8b-a94a-4236-97d2-dd18c9911fbd>, work_id: #<UUID:0x3256270 UUID:67e9a1d5-b225-4fef-8ea6-26e6dafccc59>, created_at: "2015-06-01 04:03:09", updated_at: "2015-06-01 04:03:09", deleted_at: nil>

MySQL exports like this:

tag_works:
columns:

  • id
  • tag_id
  • work_id
  • created_at
  • updated_at
  • deleted_at
    records:
    • !binary |-
      ABEJVESlTOKwZzzyap6mMQ==
    • !binary |-
      qLz8i6lKQjaX0t0YyZEfvQ==
    • !binary |-
      Z+mh1bIlT++Opibm2vzMWQ==
    • 2015-06-01 04:03:09.000000000 Z
    • 2015-06-01 04:03:09.000000000 Z
    • false

While PostgreSQL, in my tests, exports using the '00110954-44a5-4ce2-b067-3cf26a9ea631' format.

I've tried patching ActiveUUID, but nothing I've done seems to effect the export - I've assumed I needed to implement UUIDTools::UUID.to_yaml ... or dump, or somthing.

Any suggestions as to what need to be implemented to change the export format?

Option to dump or load a Single Table

It would be great if you can add a way to limit a database dump or load to a single table by adding a table parameter to the rake task.

Ex.
rake db:data:dump["table_name"] -> Dump contents of Rails database table "table_name" to db/data.yml
rake db:data:load["table_name"] -> Load contents of db/data.yml into the database table "table_name"

Tables don't dump in a consistent order

I'm having issues comparing dump files generated by yaml_db because the tables don't dump in a consistent order. Records within a table dump in a consistent order because they are sorted by the first column, but the tables themselves can be returned in a random order from some database adapters. I resolved this with a simple monkey-patch, but before I work up a pull request I'd like to see if there's a consensus that resolving this is desirable.

Here's my monkey-patch (all it does is add a sort to the end of the chain):

module SerializationHelper
  class Dump
    def self.tables
      ActiveRecord::Base.connection.tables.reject { |table| ['schema_info', 'schema_migrations'].include?(table) }.sort
    end
  end
end

Issues with incomplete dumps

Anyone else having an issue where dump files are incomplete? I'm calling the gem directly from my rails app rather than using a rake task. I am calling it exactly as the rake task does. I ended up adding a flush and close after the dump and this solved my problem: AlbertGrimley@e5c3f34

Problem with Sql Server add_limit_offset!

The activerecord-sqlserver-adapter is not implementing the method.

This is the error:

This has been moved to the SQLServerCompiler in Arel.
/Users/tommasop/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-sqlserver-adapter-3.1.1/lib/active_record/connection_adapters/sqlserver/database_statements.rb:72:in `add_limit_offset!'

Ruby segmentation fault with rake db:data:dump_dir

rake db:data:dump_dir
(in /Users/adam/Development/Rails/magellan)
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:13: [BUG] Segmentation fault
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]

-- control frame ----------
c:0087 p:0011 s:0297 b:0297 l:000296 d:000296 METHOD /Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:13
c:0086 p:0022 s:0294 b:0294 l:000293 d:000293 METHOD /Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:148
c:0085 p:0054 s:0291 b:0290 l:000289 d:000289 METHOD /Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:170
c:0084 p:---- s:0286 b:0286 l:000285 d:000285 FINISH
c:0083 p:---- s:0284 b:0284 l:000283 d:000283 CFUNC  :node_export
c:0082 p:---- s:0282 b:0282 l:000281 d:000281 CFUNC  :add
c:0081 p:0014 s:0278 b:0278 l:002380 d:000277 BLOCK  /Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:114
c:0080 p:---- s:0275 b:0275 l:000274 d:000274 FINISH
c:0079 p:---- s:0273 b:0273 l:000272 d:000272 CFUNC  :each
c:0078 p:0009 s:0270 b:0270 l:002380 d:000269 BLOCK  /Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:113
c:0077 p:---- s:0267 b:0267 l:000266 d:000266 FINISH
c:0076 p:---- s:0265 b:0265 l:000264 d:000264 CFUNC  :seq
c:0075 p:0025 s:0260 b:0260 l:002380 d:000259 BLOCK  /Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:112
c:0074 p:---- s:0257 b:0257 l:000256 d:000256 FINISH
c:0073 p:---- s:0255 b:0255 l:000254 d:000254 CFUNC  :call
c:0072 p:---- s:0253 b:0253 l:000252 d:000252 CFUNC  :emit
c:0071 p:0130 s:0249 b:0249 l:000248 d:000248 METHOD /Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck.rb:401
c:0070 p:0056 s:0242 b:0242 l:002380 d:002380 METHOD /Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:111
c:0069 p:---- s:0238 b:0238 l:000237 d:000237 FINISH
c:0068 p:---- s:0236 b:0236 l:000235 d:000235 CFUNC  :node_export
c:0067 p:---- s:0234 b:0234 l:000233 d:000233 CFUNC  :add
c:0066 p:0014 s:0230 b:0230 l:000d20 d:000229 BLOCK  /Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:114
c:0065 p:---- s:0227 b:0227 l:000226 d:000226 FINISH
c:0064 p:---- s:0225 b:0225 l:000224 d:000224 CFUNC  :each
c:0063 p:0009 s:0222 b:0222 l:000d20 d:000221 BLOCK  /Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:113
c:0062 p:---- s:0219 b:0219 l:000218 d:000218 FINISH
c:0061 p:---- s:0217 b:0217 l:000216 d:000216 CFUNC  :seq
c:0060 p:0025 s:0212 b:0212 l:000d20 d:000211 BLOCK  /Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:112
c:0059 p:---- s:0209 b:0209 l:000208 d:000208 FINISH
c:0058 p:---- s:0207 b:0207 l:000206 d:000206 CFUNC  :call
c:0057 p:---- s:0205 b:0205 l:000204 d:000204 CFUNC  :emit
c:0056 p:0130 s:0201 b:0201 l:000200 d:000200 METHOD /Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck.rb:401
c:0055 p:0056 s:0194 b:0194 l:000d20 d:000d20 METHOD /Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:111
c:0054 p:---- s:0190 b:0190 l:000189 d:000189 FINISH
c:0053 p:---- s:0188 b:0188 l:000187 d:000187 CFUNC  :node_export
c:0052 p:---- s:0186 b:0186 l:000185 d:000185 CFUNC  :add
c:0051 p:0014 s:0182 b:0182 l:002140 d:000181 BLOCK  /Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:114
c:0050 p:---- s:0179 b:0179 l:000178 d:000178 FINISH
c:0049 p:---- s:0177 b:0177 l:000176 d:000176 CFUNC  :each
c:0048 p:0009 s:0174 b:0174 l:002140 d:000173 BLOCK  /Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:113
c:0047 p:---- s:0171 b:0171 l:000170 d:000170 FINISH
c:0046 p:---- s:0169 b:0169 l:000168 d:000168 CFUNC  :seq
c:0045 p:0025 s:0164 b:0164 l:002140 d:000163 BLOCK  /Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:112
c:0044 p:---- s:0161 b:0161 l:000160 d:000160 FINISH
c:0043 p:---- s:0159 b:0159 l:000158 d:000158 CFUNC  :call
c:0042 p:---- s:0157 b:0157 l:000156 d:000156 CFUNC  :emit
c:0041 p:0130 s:0153 b:0153 l:000152 d:000152 METHOD /Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck.rb:401
c:0040 p:0056 s:0146 b:0146 l:002140 d:002140 METHOD /Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:111
c:0039 p:0014 s:0142 b:0142 l:000141 d:000141 METHOD /Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/yaml_db-0.2.0/lib/yaml_db.rb:25
c:0038 p:0049 s:0137 b:0136 l:000111 d:000135 BLOCK  /Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/yaml_db-0.2.0/lib/yaml_db.rb:47
c:0037 p:0120 s:0132 b:0132 l:000121 d:000131 BLOCK  /Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/yaml_db-0.2.0/lib/serialization_helper.rb:185
c:0036 p:---- s:0127 b:0127 l:000126 d:000126 FINISH
c:0035 p:---- s:0125 b:0125 l:000124 d:000124 CFUNC  :each
c:0034 p:0130 s:0122 b:0122 l:000121 d:000121 METHOD /Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/yaml_db-0.2.0/lib/serialization_helper.rb:179
c:0033 p:0038 s:0112 b:0112 l:000111 d:000111 METHOD /Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/yaml_db-0.2.0/lib/yaml_db.rb:45
c:0032 p:0054 s:0106 b:0106 l:000105 d:000105 METHOD /Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/yaml_db-0.2.0/lib/serialization_helper.rb:164
c:0031 p:0073 s:0101 b:0101 l:000091 d:000100 BLOCK  /Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/yaml_db-0.2.0/lib/serialization_helper.rb:24
c:0030 p:---- s:0097 b:0097 l:000096 d:000096 FINISH
c:0029 p:---- s:0095 b:0095 l:000094 d:000094 CFUNC  :each
c:0028 p:0043 s:0092 b:0092 l:000091 d:000091 METHOD /Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/yaml_db-0.2.0/lib/serialization_helper.rb:21
c:0027 p:0121 s:0087 b:0087 l:000798 d:000086 BLOCK  /Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/yaml_db-0.2.0/lib/tasks/yaml_db_tasks.rake:28
c:0026 p:---- s:0083 b:0083 l:000082 d:000082 FINISH
c:0025 p:---- s:0081 b:0081 l:000080 d:000080 CFUNC  :call
c:0024 p:0043 s:0076 b:0076 l:000067 d:000075 BLOCK  /Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:636
c:0023 p:---- s:0073 b:0073 l:000072 d:000072 FINISH
c:0022 p:---- s:0071 b:0071 l:000070 d:000070 CFUNC  :each
c:0021 p:0171 s:0068 b:0068 l:000067 d:000067 METHOD /Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:631
c:0020 p:0110 s:0064 b:0064 l:000058 d:000063 BLOCK  /Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:597
c:0019 p:0019 s:0062 b:0062 l:000061 d:000061 METHOD /Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/monitor.rb:201
c:0018 p:0033 s:0059 b:0059 l:000058 d:000058 METHOD /Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:590
c:0017 p:0048 s:0053 b:0053 l:000052 d:000052 METHOD /Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:583
c:0016 p:0045 s:0048 b:0048 l:000047 d:000047 METHOD /Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2051
c:0015 p:0012 s:0041 b:0041 l:000026 d:000040 BLOCK  /Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2029
c:0014 p:---- s:0038 b:0038 l:000037 d:000037 FINISH
c:0013 p:---- s:0036 b:0036 l:000035 d:000035 CFUNC  :each
c:0012 p:0069 s:0033 b:0033 l:000026 d:000032 BLOCK  /Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2029
c:0011 p:0009 s:0031 b:0031 l:000030 d:000030 METHOD /Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2068
c:0010 p:0011 s:0027 b:0027 l:000026 d:000026 METHOD /Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2023
c:0009 p:0029 s:0024 b:0024 l:000017 d:000023 BLOCK  /Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2001
c:0008 p:0009 s:0022 b:0022 l:000021 d:000021 METHOD /Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2068
c:0007 p:0011 s:0018 b:0018 l:000017 d:000017 METHOD /Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:1998
c:0006 p:0036 s:0015 b:0015 l:000014 d:000014 TOP    /Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/bin/rake:31
c:0005 p:---- s:0013 b:0013 l:000012 d:000012 FINISH
c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC  :load
c:0003 p:0127 s:0007 b:0007 l:001598 d:0008f0 EVAL   /Users/adam/.rvm/gems/ruby-1.9.2-p0/bin/rake:19
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:001598 d:001598 TOP   
---------------------------
-- Ruby level backtrace information ----------------------------------------
/Users/adam/.rvm/gems/ruby-1.9.2-p0/bin/rake:19:in `<main>'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/bin/rake:19:in `load'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2001:in `block in run'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2029:in `block in top_level'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2 levels) in top_level'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/yaml_db-0.2.0/lib/tasks/yaml_db_tasks.rake:28:in `block (3 levels) in <top (required)>'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/yaml_db-0.2.0/lib/serialization_helper.rb:21:in `dump_to_dir'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/yaml_db-0.2.0/lib/serialization_helper.rb:21:in `each'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/yaml_db-0.2.0/lib/serialization_helper.rb:24:in `block in dump_to_dir'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/yaml_db-0.2.0/lib/serialization_helper.rb:164:in `dump_table'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/yaml_db-0.2.0/lib/yaml_db.rb:45:in `dump_table_records'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/yaml_db-0.2.0/lib/serialization_helper.rb:179:in `each_table_page'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/yaml_db-0.2.0/lib/serialization_helper.rb:179:in `each'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/yaml_db-0.2.0/lib/serialization_helper.rb:185:in `block in each_table_page'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/yaml_db-0.2.0/lib/yaml_db.rb:47:in `block in dump_table_records'
/Users/adam/.rvm/gems/ruby-1.9.2-p0/gems/yaml_db-0.2.0/lib/yaml_db.rb:25:in `chunk_records'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:111:in `to_yaml'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck.rb:401:in `quick_emit'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck.rb:401:in `emit'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck.rb:401:in `call'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:112:in `block in to_yaml'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:112:in `seq'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:113:in `block (2 levels) in to_yaml'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:113:in `each'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:114:in `block (3 levels) in to_yaml'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:114:in `add'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:114:in `node_export'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:111:in `to_yaml'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck.rb:401:in `quick_emit'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck.rb:401:in `emit'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck.rb:401:in `call'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:112:in `block in to_yaml'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:112:in `seq'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:113:in `block (2 levels) in to_yaml'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:113:in `each'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:114:in `block (3 levels) in to_yaml'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:114:in `add'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:114:in `node_export'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:111:in `to_yaml'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck.rb:401:in `quick_emit'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck.rb:401:in `emit'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck.rb:401:in `call'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:112:in `block in to_yaml'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:112:in `seq'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:113:in `block (2 levels) in to_yaml'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:113:in `each'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:114:in `block (3 levels) in to_yaml'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:114:in `add'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:114:in `node_export'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:170:in `to_yaml'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:148:in `is_complex_yaml?'
/Users/adam/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:13:in `to_yaml_properties'

-- C level backtrace information -------------------------------------------

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Abort trap

Stack Level too Deep

I keep getting this error every time I try to run rake:db:data:dump. Any one else has had this error before?

License

Under which license is this software?

t.datetime objects from MySQL dumping out as !ruby/object:Mysql::Time {}

At some point recently, t.datetime schema objects in our production MySQL DB started dumping out as:

!ruby/object:Mysql::Time {}

I've poked at it a bit, but I can't figure out which of the recently upgraded components is causing the issue. We're using the following relevant gems:

Gems included by the bundle:

  • actionmailer (3.1.3)
  • actionpack (3.1.3)
  • activemodel (3.1.3)
  • activerecord (3.1.3)
  • activeresource (3.1.3)
  • activesupport (3.1.3)
  • arel (2.2.1)
  • aws (2.5.6)
  • builder (3.0.0)
  • bundler (1.0.18)
  • capistrano (2.9.0)
  • erubis (2.7.0)
  • highline (1.6.8)
  • hike (1.2.1)
  • hpricot (0.8.5)
  • http_connection (1.4.1)
  • i18n (0.6.0)
  • jquery-rails (1.0.19)
  • json (1.6.2)
  • mail (2.3.0)
  • mime-types (1.17.2)
  • multi_json (1.0.4)
  • mysql (2.8.1)
  • net-ldap (0.2.2)
  • net-scp (1.0.4)
  • net-sftp (2.0.5)
  • net-ssh (2.2.1)
  • net-ssh-gateway (1.1.0)
  • polyglot (0.3.3)
  • rack (1.3.5)
  • rack-cache (1.1)
  • rack-mount (0.8.3)
  • rack-ssl (1.3.2)
  • rack-test (0.6.1)
  • rails (3.1.3)
  • railties (3.1.3)
  • rake (0.9.2.2)
  • rdoc (3.11)
  • route53 (0.2.1)
  • ruby-hmac (0.4.0)
  • sprockets (2.0.3)
  • sqlite3 (1.3.4)
  • thor (0.14.6)
  • tilt (1.3.3)
  • treetop (1.4.10)
  • tzinfo (0.3.31)
  • uuidtools (2.1.2)
  • will_paginate (3.0.2)
  • xml-simple (1.1.1)
  • yaml_db (0.2.2)

I've done some searching, but haven't found anybody else reporting a similar problem, so hopefully we're just doing something dumb that's easy to fix.

Thanks!

bundle doesn't install on Ruby <1.9.3

Rails 3.1 and 3.2 both have i18n ~> 0.6 in their dependency trees, but i18n 0.7.0 (released 2014-12-19) requires Ruby 1.9.3.

Rails 3.1/3.2 users on Ruby <1.9.3 will have to pin i18n to 0.6 anyway, so this won't be a yaml_db-specific issue for them. However, it breaks CI builds.

Rails 2.x support?

(Meta-issue) Now that yaml_db has returned from a 2.5-year hiatus, does anyone think it should still support Rails 2.x? Please share your opinion.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.