$ irb -r yaml
irb(main):001:0> YAML.load("hq:\n id: 1\n role_name:
HeadQuarters")
=> {"hq"=>{"id"=>1,
"role_name"=>"HeadQuarters"}}
irb(main):002:0> YAML.load("hq:\n\tid: 1\n\trole_name:
HeadQuarters")
ArgumentError: syntax error on line 1, col 4: ` id: 1''
from /usr/lib/ruby/1.8/yaml.rb:133:in `load''
from /usr/lib/ruby/1.8/yaml.rb:133:in `load''
from (irb):2>>
Make sure JEdit isn''t including tabs BEFORE id: and role_name:
On Mar 11, 8:28 pm, "K. Rajesh"
<kaviraj...-uAjRD0nVeow@public.gmane.org> wrote:> Hi,
>
> I cant get yaml fixtures to load. The brief error is
>
> Errno::ENOENT: No such file or directory - some.
>
> I have NO idea what this ''some'' is.
>
> The yaml file is simplicity itself.
>
> hq:
> id: 1
> role_name: HeadQuarters
>
> I have tried this with
> a) One space after the colon following id and role_name
> b) Indented perfectly according to JEdit.
>
> Both give the same error. Any thoughts?
>
> Regards,
> Rajesh
>
> The complete error message is below.
>
> Fixture::FormatError: a YAML error occured parsing F:/railswork/kbase/
> config/../
> test/fixtures/roles.yml. Please note that YAML must be consistently
> indented usi
> ng spaces. Tabs are not allowed. Please have a look
athttp://www.yaml.org/faq.h
> tml
> The exact error was:
> Errno::ENOENT: No such file or directory - some
> e:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/
> active_record/fixture
> s.rb:311:in `read_fixture_files''
> e:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/
> active_record/fixture
> s.rb:279:in `initialize''
> e:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/
> active_record/fixture
> s.rb:251:in `new''
> e:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/
> active_record/fixture
> s.rb:251:in `create_fixtures''
> e:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/
> active_record/fixture
> s.rb:250:in `map''
> e:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/
> active_record/fixture
> s.rb:250:in `create_fixtures''
> e:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/
> active_record/base.rb
> :794:in `silence''
> e:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/
> active_record/fixture
> s.rb:248:in `create_fixtures''
> e:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/
> active_record/fixture
> s.rb:565:in `load_fixtures''
> e:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/
> active_record/fixture
> s.rb:512:in `setup''
>
> 2) Error:
> test_unique_role(RoleTest):
> NoMethodError: You have a nil object when you didn''t expect it!
> You might have expected an instance of Array.
> The error occured while evaluating nil.-
> e:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/
> active_record/transac
> tions.rb:112:in `unlock_mutex''
> e:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/
> active_record/fixture
> s.rb:534:in `teardown''
>
> 1 tests, 0 assertions, 0 failures, 2 errors
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---