You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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'
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?
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:
syck:
Loading
yaml_db doesn't complain while dumping but those difference make yaml_db:load fail.
it's easily reproducible (ruby 1.9.2 / rails 3.0.7):
`
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
The text was updated successfully, but these errors were encountered: