Hi, I''m having a problem loading a sample data with simple rake command. rake db:fixtures:load When I run the above command,I get the following error $rake db:fixtures:load (in /home/raghu/www/photos) rake aborted! a YAML error occurred parsing /home/raghu/www/photos/test/fixtures/photos.yml. Please note that YAML must be consistently indented using spaces. Tabs are not allowed. Please have a look at http://www.yaml.org/faq.html The exact error was: ArgumentError: syntax error on line 14, col 11: ` filename: train.jpg'' (See full trace by running task with --trace) Here is the file that can be useful # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html one: filename: MyString thumbnail: MyString description: MyString two: filename: MyString thumbnail: MyString description: MyString photo_1: id:1 filename: train.jpg thumbnail: train_t.jpg description: My ride to work photo_2: id: 2 filename: lighthouse.jpg thumbnail: lighthouse_t.jpg description: I take dates here all the time photo_3: id: 3 filename: gargoyle.jpg thumbnail: gargoyle_t.jpg description: My paper weight photo_4: id: 4 filename: cat.jpg thumbnail: cat_t.jpg description: My pet photo_5: id: 5 filename: cappucino.jpg thumbnail: cappucino_t.jpg description: Life Juice photo_6: id: 6 filename: building.jpg thumbnail: building_t.jpg description: My office photo_7: id: 7 filename: bridge.jpg thumbnail: bridge_t.jpg description: Place I''d like to visit Any idea of what might went wrong? Raghu -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 26 March 2010 20:39, Raghu Maddali <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi, > > I''m having a problem loading a sample data with simple rake command. > rake db:fixtures:load > > When I run the above command,I get the following error > > $rake db:fixtures:load > (in /home/raghu/www/photos) > rake aborted! > a YAML error occurred parsing > /home/raghu/www/photos/test/fixtures/photos.yml. Please note that YAML > must be consistently indented using spaces. Tabs are not allowed. Please > have a look at http://www.yaml.org/faq.html > The exact error was: > ArgumentError: syntax error on line 14, col 11: ` filename: > train.jpg'' > > (See full trace by running task with --trace) > > Here is the file that can be useful > > # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html > > one: > filename: MyString > thumbnail: MyString > description: MyString > > two: > filename: MyString > thumbnail: MyString > description: MyString > > photo_1: > id:1 > filename: train.jpgHave you double checked there are no tabs on the line above? Also try deleting it, retyping it, changing it to something that works then changing it back again etc etc Basically try things to get a handle on the problem. Colin> thumbnail: train_t.jpg > description: My ride to work-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hey, The error is that there''s no space in "id:1" in the YAML. /Lasse 2010/3/26 Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>> On 26 March 2010 20:39, Raghu Maddali <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > Hi, > > > > I''m having a problem loading a sample data with simple rake command. > > rake db:fixtures:load > > > > When I run the above command,I get the following error > > > > $rake db:fixtures:load > > (in /home/raghu/www/photos) > > rake aborted! > > a YAML error occurred parsing > > /home/raghu/www/photos/test/fixtures/photos.yml. Please note that YAML > > must be consistently indented using spaces. Tabs are not allowed. Please > > have a look at http://www.yaml.org/faq.html > > The exact error was: > > ArgumentError: syntax error on line 14, col 11: ` filename: > > train.jpg'' > > > > (See full trace by running task with --trace) > > > > Here is the file that can be useful > > > > # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html > > > > one: > > filename: MyString > > thumbnail: MyString > > description: MyString > > > > two: > > filename: MyString > > thumbnail: MyString > > description: MyString > > > > photo_1: > > id:1 > > filename: train.jpg > > Have you double checked there are no tabs on the line above? > Also try deleting it, retyping it, changing it to something that works > then changing it back again etc etc > Basically try things to get a handle on the problem. > > Colin > > > thumbnail: train_t.jpg > > description: My ride to work > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law wrote:> On 26 March 2010 20:39, Raghu Maddali <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> a YAML error occurred parsing >> >> �description: MyString >> >> photo_1: >> �id:1 >> �filename: train.jpg > > Have you double checked there are no tabs on the line above? > Also try deleting it, retyping it, changing it to something that works > then changing it back again etc etc > Basically try things to get a handle on the problem. > > ColinAre you referring to the tab above photo_1/description...If you are talking about tabs b/w filename: train.jpg,I''m sure that there are no tabs b/w them except a single character space. Raghu -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Lasse Bunk wrote:> Hey, > > The error is that there''s no space in "id:1" in the YAML. > > /Lasse > > 2010/3/26 Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>Hi Lasse, I''ve even tried that but gives me same error. Raghu -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 27 March 2010 16:39, Raghu Maddali <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Colin Law wrote: >> On 26 March 2010 20:39, Raghu Maddali <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >>> a YAML error occurred parsing >>> >>> �description: MyString >>> >>> photo_1: >>> �id:1 >>> �filename: train.jpg >> >> Have you double checked there are no tabs on the line above? >> Also try deleting it, retyping it, changing it to something that works >> then changing it back again etc etc >> Basically try things to get a handle on the problem. >> >> Colin > > Are you referring to the tab above photo_1/description...If you are > talking about tabs b/w filename: train.jpg,I''m sure that there are no > tabs b/w them except a single character space.There should be no tab characters anywhere in yaml files. Lasse is right that there should be space after id: in the line above. So having fixed that what was the result of my other suggestions? Deleting that line, retyping it, pasting in a line that you know works and so on. If the line in that position keeps giving an error whatever you do then it is probably the line above, I assumed Lasse''s suggestion would fix it. Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I tried parsing the YAML as given by Raghu, and it worked after fixing the "id:1" > "id: 1" error. /Lasse 2010/3/27 Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>> On 27 March 2010 16:39, Raghu Maddali <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > Colin Law wrote: > >> On 26 March 2010 20:39, Raghu Maddali <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > >>> a YAML error occurred parsing > >>> > >>> �description: MyString > >>> > >>> photo_1: > >>> �id:1 > >>> �filename: train.jpg > >> > >> Have you double checked there are no tabs on the line above? > >> Also try deleting it, retyping it, changing it to something that works > >> then changing it back again etc etc > >> Basically try things to get a handle on the problem. > >> > >> Colin > > > > Are you referring to the tab above photo_1/description...If you are > > talking about tabs b/w filename: train.jpg,I''m sure that there are no > > tabs b/w them except a single character space. > > There should be no tab characters anywhere in yaml files. Lasse is > right that there should be space after id: in the line above. > So having fixed that what was the result of my other suggestions? > Deleting that line, retyping it, pasting in a line that you know works > and so on. If the line in that position keeps giving an error > whatever you do then it is probably the line above, I assumed Lasse''s > suggestion would fix it. > > Colin > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Reasonably Related Threads
- Error: did not find expected key while parsing a block mapping
- testing chapter: agile web dev withrails
- #create tests fail when I add FriendlyId to my model
- Weird behaviour of tab characters in a string in R (vs Python)
- getting all pairwise combinations of elements in a character string