Yabe Initial-Data.yml 找到字符 '\t'错误

发布于 2024-11-29 19:42:36 字数 3281 浏览 5 评论 0原文

我正在使用 Yabe 教程中的标签,并且遇到了初始 data.yml 的问题,

我已经确认它与示例版本相似,只是缺少复制和粘贴。

这是我看到的,

Malformed YAML 

Cannot parse the /conf/initial-data.yml file: found character '\t' that cannot start any token 


In /conf/initial-data.yml (around line 15)

11:     password:       secret
12:     fullname:       Jeff    
13: 
14: Tag(play):
15:     name:           Play
16:     
17: Tag(architecture):
18:     name:           Architecture
19:     
20: Tag(test):
21:     name:           Test

这是我的 yml

User(bob):
    email:          [email protected]
    password:       secret
    fullname:       Bob
    isAdmin:        true

User(jeff):
    email:          [email protected]
    password:       secret
    fullname:       Jeff    

Tag(play):
    name:           Play

Tag(architecture):
    name:           Architecture

Tag(test):
    name:           Test

Tag(mvc):
    name:           MVC    

Post(firstBobPost):
    title:          About the model layer
    postedAt:       2009-06-14
    author:         bob
    content:        >
                    The model has a central position in a Play! application. It is the domain-specific 
                    representation of the information on which the application operates.

                    Martin fowler defines it as:

                    Responsible for representing concepts of the business, information about the 
                    business situation, and business rules. State that reflects the business situation 
                    is controlled and used here, even though the technical details of storing it are 
                    delegated to the infrastructure. This layer is the heart of business software.

Post(secondBobPost):
    title:          Just a test of YABE
    postedAt:       2009-03-25
    author:         bob
    content:        >
                    Well, it's just a test.

Post(jeffPost):
    title:          The MVC application
    postedAt:       2009-06-06
    author:         jeff
    tags:
                    - play
                    - architecture
                    - mvc
    content:        >
                    A Play! application follows the MVC architectural pattern as applied to the 
                    architecture of the Web.

                    This pattern splits the application into separate layers: the Presentation 
                    layer and the Model layer. The Presentation layer is further split into a 
                    View and a Controller layer.

Comment(c1):
    author:         Guest
    content:        >
                    You are right !
    postedAt:       2009-06-14
    post:           firstBobPost

Comment(c2):
    author:         Mike
    content:        >
                    I knew that ...
    postedAt:       2009-06-15
    post:           firstBobPost    

Comment(c3):
    author:         Tom
    content:        >
                    This post is useless ?
    postedAt:       2009-04-05
    post:           secondBobPost

I'm working with tags in the Yabe tutorial and am running into an issue with my initial-data.yml

I already confirmed it's likeness to the samples version stopping just short of a copy and paste.

here is what I see

Malformed YAML 

Cannot parse the /conf/initial-data.yml file: found character '\t' that cannot start any token 


In /conf/initial-data.yml (around line 15)

11:     password:       secret
12:     fullname:       Jeff    
13: 
14: Tag(play):
15:     name:           Play
16:     
17: Tag(architecture):
18:     name:           Architecture
19:     
20: Tag(test):
21:     name:           Test

here is my yml

User(bob):
    email:          [email protected]
    password:       secret
    fullname:       Bob
    isAdmin:        true

User(jeff):
    email:          [email protected]
    password:       secret
    fullname:       Jeff    

Tag(play):
    name:           Play

Tag(architecture):
    name:           Architecture

Tag(test):
    name:           Test

Tag(mvc):
    name:           MVC    

Post(firstBobPost):
    title:          About the model layer
    postedAt:       2009-06-14
    author:         bob
    content:        >
                    The model has a central position in a Play! application. It is the domain-specific 
                    representation of the information on which the application operates.

                    Martin fowler defines it as:

                    Responsible for representing concepts of the business, information about the 
                    business situation, and business rules. State that reflects the business situation 
                    is controlled and used here, even though the technical details of storing it are 
                    delegated to the infrastructure. This layer is the heart of business software.

Post(secondBobPost):
    title:          Just a test of YABE
    postedAt:       2009-03-25
    author:         bob
    content:        >
                    Well, it's just a test.

Post(jeffPost):
    title:          The MVC application
    postedAt:       2009-06-06
    author:         jeff
    tags:
                    - play
                    - architecture
                    - mvc
    content:        >
                    A Play! application follows the MVC architectural pattern as applied to the 
                    architecture of the Web.

                    This pattern splits the application into separate layers: the Presentation 
                    layer and the Model layer. The Presentation layer is further split into a 
                    View and a Controller layer.

Comment(c1):
    author:         Guest
    content:        >
                    You are right !
    postedAt:       2009-06-14
    post:           firstBobPost

Comment(c2):
    author:         Mike
    content:        >
                    I knew that ...
    postedAt:       2009-06-15
    post:           firstBobPost    

Comment(c3):
    author:         Tom
    content:        >
                    This post is useless ?
    postedAt:       2009-04-05
    post:           secondBobPost

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

み零 2024-12-06 19:42:36

第 15-23 行有选项卡:

    name:\t\t\tPlay
\t
Tag(architecture):
    name:\t\t\tArchitecture
\t
Tag(test):
    name:\t\t\Test
\t
Tag(mvc):
    name:\t\t\tMVC    
\t

yaml 中不允许使用选项卡:

标签已被取缔,因为它们受到不同的对待
不同的编辑器和工具。由于缩进对于
YAML 的正确解释,这个问题太棘手了
试图。事实上,Python 的 Guido van Rossum 已经承认了这一点
允许在 Python 源代码中使用 TAB 对许多人来说是一件令人头疼的事情
如果他再次设计 Python,他会禁止它们。

You have tabs on line 15-23:

    name:\t\t\tPlay
\t
Tag(architecture):
    name:\t\t\tArchitecture
\t
Tag(test):
    name:\t\t\Test
\t
Tag(mvc):
    name:\t\t\tMVC    
\t

Tabs are not allowed in yaml:

Tabs have been outlawed since they are treated differently by
different editors and tools. And since indentation is so critical to
proper interpretation of YAML, this issue is just too tricky to even
attempt. Indeed Guido van Rossum of Python has acknowledged that
allowing TABs in Python source is a headache for many people and that
were he to design Python again, he would forbid them.

沉默的熊 2024-12-06 19:42:36

切勿在 YAML 中的行首使用字符“\t”选项卡。只需使用空格即可!

Never use character "\t" tab in your YAML at the beginning of a line. Just use SPACES!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文