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