2
我是新来YAML,并试图做一个YAML块,但我收到以下错误YAML块:错误而解析文本
while scanning a block mapping: expected , but found: #< ScalarToken Value="content: | This is a test of a test test test test A very very good test yeah yeah A test of test test" Style="None"> (line 8, column 1)
虽然作品,未经精|,我想空白保存。
YAML文件(Home.yml):
---
section:
title: About this site
content: |
This is a test of a test test test test
A very very good test
A test of test test
section:
title: Source code
content: |
Licens:: BSD
Link:: Here
Foo
...
Ruby代码:
home = YAML.load_file('data/Home.yml')
home.inspect
我发现YAML禁止标签,因为它是一种空白的它是不可能的,我通过看实例知道。我确实将第二件事纠正为列表,因为这只是我忘了的一件事,但无论如何感谢您的帮助! – 2011-05-18 19:31:33
我使用的是默认值?其中一个IronRuby 1.1.2应该与Ruby 1.9兼容 – 2011-05-18 19:32:10
@Yet另一个极客:哦,是的,标签:继续奉献的礼物。我很高兴你把它理顺了。 – 2011-05-18 19:36:29