Skip to content

Instantly share code, notes, and snippets.

@deathbob
Created January 14, 2011 20:21
Show Gist options
  • Select an option

  • Save deathbob/780165 to your computer and use it in GitHub Desktop.

Select an option

Save deathbob/780165 to your computer and use it in GitHub Desktop.
Loading development environment (Rails 3.0.3)
no such file to load -- wirble
ruby-1.8.7-p302 > c = Content.first
=> #<Content id: 2, title: "I win", body: nil, tipe: nil, dom_id: nil, position: nil, visible: nil, created_at: "2011-01-14 20:19:37", updated_at: "2011-01-14 20:19:37">
ruby-1.8.7-p302 > tom = c.to_yaml
=> "--- !ruby/object:Content \nattributes: \n position: \n tipe: \n created_at: 2011-01-14 20:19:37.813214\n title: I win\n body: \n dom_id: \n updated_at: 2011-01-14 20:19:37.813214\n id: 2\n visible: \nattributes_cache: {}\n\nchanged_attributes: {}\n\ndestroyed: false\nmarked_for_destruction: false\npersisted: true\npreviously_changed: {}\n\nreadonly: false\n"
ruby-1.8.7-p302 > YAML.load(tom)
NoMethodError: undefined method `keys' for nil:NilClass
from /Users/bob/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-3.0.3/lib/active_support/whiny_nil.rb:48:in `method_missing'
from /Users/bob/.rvm/gems/ruby-1.8.7-p302/gems/activerecord-3.0.3/lib/active_record/base.rb:1512:in `attribute_names'
from /Users/bob/.rvm/gems/ruby-1.8.7-p302/gems/activerecord-3.0.3/lib/active_record/base.rb:1569:in `attributes'
from /Users/bob/.rvm/gems/ruby-1.8.7-p302/gems/activerecord-3.0.3/lib/active_record/attribute_methods.rb:57:in `attribute_method?'
from /Users/bob/.rvm/gems/ruby-1.8.7-p302/gems/activemodel-3.0.3/lib/active_model/attribute_methods.rb:394:in `match_attribute_method?'
from /Users/bob/.rvm/gems/ruby-1.8.7-p302/gems/activemodel-3.0.3/lib/active_model/attribute_methods.rb:393:in `each'
from /Users/bob/.rvm/gems/ruby-1.8.7-p302/gems/activemodel-3.0.3/lib/active_model/attribute_methods.rb:393:in `match_attribute_method?'
from /Users/bob/.rvm/gems/ruby-1.8.7-p302/gems/activemodel-3.0.3/lib/active_model/attribute_methods.rb:378:in `respond_to?'
from /Users/bob/.rvm/gems/ruby-1.8.7-p302/gems/activerecord-3.0.3/lib/active_record/attribute_methods.rb:52:in `respond_to?'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:133:in `transfer'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:133:in `node_import'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:133:in `load'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml.rb:133:in `load'
from (irb):3
ruby-1.8.7-p302 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment