Getting "couldn't parse YAML at line 6 column 50" when trying to load sample data.

337 views
Skip to first unread message

Joenah

unread,
Feb 8, 2011, 8:34:04 AM2/8/11
to Spree
Hi everybody! Hope someone will help me.
I'm trying to set up a rails app with spree, with the help to this
tutorial:
http://spreecommerce.com/documentation/getting_started.html

Everything goes fine until point 4.6, where I run $ rake db:bootstrap
It runs well until the moment it asks me to load or not the Sample
Data.
Of course I want it, so I say "yes" and get the following YAML error.

loading fixture /home/iurii/mystore/db/default/countries.yml
loading fixture /home/iurii/mystore/db/default/roles.yml
loading fixture /home/iurii/mystore/db/default/states.yml
loading fixture /home/iurii/mystore/db/default/zone_members.yml
loading fixture /home/iurii/mystore/db/default/zones.yml
Default data has been loaded
Load Sample Data? [y/n]: y
loading fixture /home/iurii/mystore/db/sample/addresses.yml
rake aborted!
couldn't parse YAML at line 6 column 50

/home/iurii/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/psych.rb:148:in
`parse'
/home/iurii/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/psych.rb:148:in
`parse_stream'
/home/iurii/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/psych.rb:119:in
`parse'
/home/iurii/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/psych.rb:106:in
`load'
/home/iurii/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/psych.rb:205:in
`load_file'
/home/iurii/.rvm/gems/ruby-1.9.2-p0/gems/i18n-0.5.0/lib/i18n/backend/
base.rb:170:in `load_yml'

etc etc etc


I also tried to use the edge source of spree, and followed the
instructions:
https://github.com/spree/spree
Got the same error. My friend also got this error when trying to use
edge source.

I'd appreciate any thoughts on how to fix it and I'd like to hear If
there is anybody else getting this error.
Thanks!


stefanigustavo

unread,
Feb 8, 2011, 10:34:47 AM2/8/11
to Spree
I am getting the same issue.

Running windows xp
Rails 3.0.3
Ruby 1.9.2

I also tried only rake db:sample, same error

Maybe we are missing a dependency.

Brian Quinn

unread,
Feb 8, 2011, 11:09:51 AM2/8/11
to spree...@googlegroups.com
I don't see the error using edge, and doing "rake sandbox" - did u try that?

what gem version where you using?


--
You received this message because you are subscribed to the Google Groups "Spree" group.
To post to this group, send email to spree...@googlegroups.com.
To unsubscribe from this group, send email to spree-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.




--
Brian Quinn

-------------------------------------------
Rails Dog LLC
2 Wisconsin Circle, Suite 700
Chevy Chase, MD 20815
voice: (301)560-2000
-------------------------------------------

stefanigustavo

unread,
Feb 8, 2011, 11:25:28 AM2/8/11
to Spree
It seems like the issue is because the YAML parser has a bug.
I am running rubygems 1.5.0

I followed the suggestions in this post:
http://www.ruby-forum.com/topic/1002689

And explicity setted another YAML parser at the top of my boot.rb
file:

require 'yaml'
YAML::ENGINE.yamler= 'syck'

It worked well for me and I hope if works for you too.

Regards,
Gustavo

Joenah

unread,
Feb 8, 2011, 6:15:50 PM2/8/11
to Spree
Excellent! It worked for me too!
Thanks everybody!

mbello

unread,
Mar 6, 2011, 11:27:22 AM3/6/11
to Spree
Thanks!
Faced this issue today (on Ubuntu Maverick) and adding those 2 lines
to boot.rb did the trick.

By the way, for newbies out there (like me) boot.rb is found in the
"config" directory of your rails/spree app.

May I suggest the dev team add the following tips to the Getting
Started Guide:

1. Ubuntu users should have the rails-dev package installed
2. Make it clear that users should have Rails 3.0.4 or the latest
spree version won't install (rails 3.0.5 won't work)
3. Add this "require 'yaml' / YAML::ENGINE.yamler= 'syck' " trick.

I could contribute, but you guys have made it too complicated to
contribute. Honestly, a wiki-style documentation system is much easier
than asking people to use git, clone the spree-guides tree, send an
email to spree-user, etc... KISS.

Best regards,

Marcelo
Reply all
Reply to author
Forward
0 new messages