ruby - "Suddenly" am getting an Invalid Subclass Error when calling YAML.load_file -
i'm using: rails 3.0.7 , rspec 2.5.0 via rvm
when run spec (using autotest or bundle exec autotest or bundle exec rspec spec/) below:
require 'spec_helper' require 'yaml' def twitter_feed(id=1) ruby_object = yaml.load_file(::rails.root.to_s + "/spec/fixtures/feeds/twitter_response_#{id}.yml") end
i this:
failure/error: ruby_object = yaml.load_file(::rails.root.to_s + "/spec/fixtures/feeds/twitter_response_#{id}.yml") typeerror: invalid subclass # ./spec/models/tweet_spec.rb:6:in `twitter_feed' # /users/natebean/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/yaml.rb:133:in `transfer' # /users/natebean/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/yaml.rb:133:in `node_import' # /users/natebean/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/yaml.rb:133:in `load' # /users/natebean/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/yaml.rb:133:in `load' # /users/natebean/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/yaml.rb:144:in `load_file' # /users/natebean/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/yaml.rb:143:in `open' # /users/natebean/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/yaml.rb:143:in `load_file' # ./spec/models/tweet_spec.rb:5:in `twitter_feed' # ./spec/models/tweet_spec.rb:58
this "was" working. can't find other information on error on internet. i've moved rails 3.0.3 3.0.7, don't remember not working after upgrade.
any suggestions? thanks.
the yaml file pulling looking hashie::mash map data to. know didn't need require 'hashie', has "fixed problem".
i added spec , working.
require 'hashie'
Comments
Post a Comment