cannot destroy a database using rake - ruby-on-rails

I am new to rails and while practising the tutorials I got the following error. Any ideas..
$ rake destroy scaffold Microposts --trace
rake aborted!
Don't know how to build task 'destroy'
/home/keval/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/task_manager.rb:49:in `[]'
/home/keval/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:115:in `invoke_task'
/home/keval/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/home/keval/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/home/keval/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/home/keval/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/keval/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/home/keval/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/home/keval/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/keval/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/home/keval/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/home/keval/.rvm/gems/ruby-1.9.3-p194#global/bin/rake:19:in `load'
/home/keval/.rvm/gems/ruby-1.9.3-p194#global/bin/rake:19:in `<main>'

trey rails destroy scaffold Microposts

Related

Can't rake build. Stack trace points to ruby_executable_hooks

I'm not sure when this happened, but I've gotten my environment into a state where I can't rake build. I looked at the stack trace, but nothing in it is helpful for me.
$ bundle exec rake build --trace
rake aborted!
Don't know how to build task 'build' (see --tasks)
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.1.2/lib/rake/task_manager.rb:71:in `[]'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.1.2/lib/rake/application.rb:149:in `invoke_task'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.1.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.1.2/lib/rake/application.rb:106:in `each'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.1.2/lib/rake/application.rb:106:in `block in top_level'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.1.2/lib/rake/application.rb:115:in `run_with_threads'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.1.2/lib/rake/application.rb:100:in `top_level'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.1.2/lib/rake/application.rb:78:in `block in run'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.1.2/lib/rake/application.rb:176:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.1.2/lib/rake/application.rb:75:in `run'
/usr/local/rvm/gems/ruby-2.3.0/gems/rake-11.1.2/bin/rake:33:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.3.0/bin/rake:23:in `load'
/usr/local/rvm/gems/ruby-2.3.0/bin/rake:23:in `<main>'
/usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'

state_machine draw throws uninitialized constant error

On a Rails 3.2 application
Gemfile:
gem "state_machine", "~> 1.1.2"
gem 'ruby-graphviz', :require => 'graphviz'
I installed and use with success the state_machine gem, only when I try to draw the state graph
rake state_machine:draw CLASS=Entity
it throws me this error:
** Invoke state_machine:draw (first_time)
** Execute state_machine:draw
** Invoke environment (first_time)
** Execute environment
rake aborted!
uninitialized constant StateMachine::Machine::Constants
/Users/joel/.rvm/gems/ruby-1.9.2-p290#biowatts/gems/state_machine-1.1.2/lib/state_machine/machine.rb:1898:in `draw'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#biowatts/gems/state_machine-1.1.2/lib/state_machine/machine.rb:481:in `block (2 levels) in draw'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#biowatts/gems/state_machine-1.1.2/lib/state_machine/machine.rb:480:in `each_value'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#biowatts/gems/state_machine-1.1.2/lib/state_machine/machine.rb:480:in `block in draw'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#biowatts/gems/state_machine-1.1.2/lib/state_machine/machine.rb:472:in `each'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#biowatts/gems/state_machine-1.1.2/lib/state_machine/machine.rb:472:in `draw'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#biowatts/gems/state_machine-1.1.2/lib/tasks/state_machine.rb:27:in `block (2 levels) in <top (required)>'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-10.1.0/lib/rake/task.rb:236:in `call'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-10.1.0/lib/rake/task.rb:236:in `block in execute'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-10.1.0/lib/rake/task.rb:231:in `each'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-10.1.0/lib/rake/task.rb:231:in `execute'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-10.1.0/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/Users/joel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-10.1.0/lib/rake/task.rb:161:in `invoke'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-10.1.0/lib/rake/application.rb:149:in `invoke_task'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-10.1.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-10.1.0/lib/rake/application.rb:106:in `each'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-10.1.0/lib/rake/application.rb:106:in `block in top_level'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-10.1.0/lib/rake/application.rb:115:in `run_with_threads'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-10.1.0/lib/rake/application.rb:100:in `top_level'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-10.1.0/lib/rake/application.rb:78:in `block in run'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#global/bin/rake:19:in `load'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#global/bin/rake:19:in `<main>'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#biowatts/bin/ruby_noexec_wrapper:14:in `eval'
/Users/joel/.rvm/gems/ruby-1.9.2-p290#biowatts/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => state_machine:draw
Any leads on how to troubleshoot this one?
Dirty but works:
unless defined? StateMachine::Machine::Constants::RGV_VERSION
warn "StateMachine::Machine::Constants overriden in #{__FILE__}"
class StateMachine::Machine::Constants
RGV_VERSION = /^[ ]*ruby-graphviz \(([0-9.]+)\)/.match(`cat #{Rails.root.join 'Gemfile.lock'}`)[1]
end
end
To elaborate on tsiruu answer: in case you are using rails, just take his code and put it in an initializer
unless defined? StateMachine::Machine::Constants::RGV_VERSION
warn "StateMachine::Machine::Constants overriden in #{__FILE__}"
class StateMachine::Machine::Constants
RGV_VERSION = /^[ ]*ruby-graphviz \(([0-9.]+)\)/.match(`cat #{Rails.root.join 'Gemfile.lock'}`)[1]
end
end

Uninitialized constant error with rake db:seed and mongoid

I'm getting this error when I am trying to rake data into my application.
I have a JSON file that looks like…
[{"code": "OCH", "name": "blah", "location": "Texas, United States"},…
My db:seeds looks like:
Airport.delete_all
airport_codes = JSON.parse(File.read(Rails.root.join('db/airport_codes.json')))
airport_codes.each do |code|
Airport.create!(code)
end
And my stack trace:
/Users/nicholasshook/.rvm/gems/ruby-1.9.3-p194#swlv/gems/mongoid-3.0.16/lib/mongoid/railties/database.rake:13:in `block (2 levels) in <top (required)>'
/Users/nicholasshook/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-10.0.3/lib/rake/task.rb:228:in `call'
/Users/nicholasshook/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-10.0.3/lib/rake/task.rb:228:in `block in execute'
/Users/nicholasshook/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-10.0.3/lib/rake/task.rb:223:in `each'
/Users/nicholasshook/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-10.0.3/lib/rake/task.rb:223:in `execute'
/Users/nicholasshook/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-10.0.3/lib/rake/task.rb:166:in `block in invoke_with_call_chain'
/Users/nicholasshook/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/nicholasshook/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-10.0.3/lib/rake/task.rb:159:in `invoke_with_call_chain'
/Users/nicholasshook/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-10.0.3/lib/rake/task.rb:152:in `invoke'
/Users/nicholasshook/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-10.0.3/lib/rake/application.rb:143:in `invoke_task'
/Users/nicholasshook/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-10.0.3/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/Users/nicholasshook/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-10.0.3/lib/rake/application.rb:101:in `each'
/Users/nicholasshook/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-10.0.3/lib/rake/application.rb:101:in `block in top_level'
/Users/nicholasshook/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-10.0.3/lib/rake/application.rb:110:in `run_with_threads'
/Users/nicholasshook/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-10.0.3/lib/rake/application.rb:95:in `top_level'
/Users/nicholasshook/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-10.0.3/lib/rake/application.rb:73:in `block in run'
/Users/nicholasshook/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
/Users/nicholasshook/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-10.0.3/lib/rake/application.rb:70:in `run'
/Users/nicholasshook/.rvm/gems/ruby-1.9.3-p194#global/gems/rake-10.0.3/bin/rake:33:in `<top (required)>'
/Users/nicholasshook/.rvm/gems/ruby-1.9.3-p194#global/bin/rake:19:in `load'
/Users/nicholasshook/.rvm/gems/ruby-1.9.3-p194#global/bin/rake:19:in `<main>'
/Users/nicholasshook/.rvm/gems/ruby-1.9.3-p194#swlv/bin/ruby_noexec_wrapper:14:in `eval'
/Users/nicholasshook/.rvm/gems/ruby-1.9.3-p194#swlv/bin/ruby_noexec_wrapper:14:in `<main>'
Thanks!
Hope you have created your rake task like this
task :<rake task name> => :environment do
Airport.delete_all
airport_codes = JSON.parse(File.read(Rails.root.join('db/airport_codes.json')))
airport_codes.each do |code|
Airport.create!(code)
end
end
if this is also correct, then try to include your airport.rb to your rake file
require 'airport.rb'
, but as far as I know above rake task format should work for you
HTH

"rake aborted! undefined method `[]=' for nil:NilClass" message when running rake in cron job

I am a ROR noob who has inherited a project (Ruby version 1.9.3p0, Rails version 3.0.6, rake version 0.9.2) which performs a rake as part of a cronjob. This has been outputting "rake aborted! undefined method `[]=' for nil:NilClass" into its log file. When I perform a trace I get the following output:
rake aborted!
undefined method `[]=' for nil:NilClass
/var/www/nostos-source-illiad/lib/nostos-source-illiad/record.rb:48:in `block in charge!'
(eval):22:in `form_with'
/var/www/nostos-source-illiad/lib/nostos-source-illiad/record.rb:47:in `charge!'
/var/www/nostos/app/models/transaction.rb:65:in `block (2 levels) in sync!'
/var/www/nostos/app/models/transaction.rb:58:in `each'
/var/www/nostos/app/models/transaction.rb:58:in `block in sync!'
/var/www/nostos/app/models/transaction.rb:57:in `each'
/var/www/nostos/app/models/transaction.rb:57:in `sync!'
/var/www/nostos/lib/tasks/nostos.rake:17:in `block (2 levels) in <top (required)>'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/bin/rake:19:in `load'
/home/deployer/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/bin/rake:19:in `<main>'
Tasks: TOP => nostos:cron
I am having trouble determining what exactly is causing this issue and was looking for some advice/direction. I do not think this is caused by the same issue reported here but I am not definite. Any help would be appreciated. Thanks!
EDIT:
Code for nostos:rakecan be found here.
Code for transaction.rb can be found here.
Upon further review, this issue appears to have been due to an invalid set of credentials being passed in. Resolving this removed the above messages. Thanks for looking into this!

YAML DB won't run due to evaluating nil.each

So this problem is occurring for me on both RHEL5 and OSX Lion. Both environments are running 1.9.2-p290 ruby installed with RVM.
When I run the following command I get the following problem:
[master][~/Sites/boss-mocha] bundle exec rake db:data:load --trace
** Invoke db:data:load (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:data:load
rake aborted!
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
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/serialization_helper.rb:85:in `load_records'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/serialization_helper.rb:74:in `load_table'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/yaml_db.rb:63:in `block (2 levels) in load_documents'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/yaml_db.rb:61:in `each'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/yaml_db.rb:61:in `block in load_documents'
/Users/pma/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/deprecated.rb:30:in `each'
/Users/pma/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/deprecated.rb:30:in `load_documents'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/yaml_db.rb:60:in `load_documents'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/serialization_helper.rb:57:in `block in load'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.10/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/serialization_helper.rb:56:in `load'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/serialization_helper.rb:31:in `load'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/yaml_db-0.2.1/lib/tasks/yaml_db_tasks.rake:35:in `block (3 levels) in <top (required)>'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/pma/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `<main>'
Tasks: TOP => db:data:load
The YAML being produced by rake db:data:dump appears mal-formed, with spurious "---"s between the "records" list and the actual records.
Removing the inappropriate "---" allows the data to load. I haven't created a pull request for the fix yet, but after tracking it down I noticed someone else reported it as an issue on github:
https://github.com/ludicast/yaml_db/issues/17
In addition, changing the YAML engine as in the link below produces correct output, eliminating the need for editing the file manually (or fixing yaml_db).
rails error, couldn't parse YAML

Resources