I'm getting “found character that cannot start any token while scanning for the next token”

后端 未结 7 1735
無奈伤痛
無奈伤痛 2021-01-07 16:07

I have been running Ruby on Rails on my laptop for about a month now, but when I wanted to run the server in this instance (and it was working fine a few hours ago) I now re

相关标签:
7条回答
  • 2021-01-07 16:54

    YAML does not accept TAB characters (\t) for indentation. Look for those in your config/application.yml and replace with 2 spaces.

    (or there may be other syntax errors, as suggested by Ryan. But I'm betting on this one)

    0 讨论(0)
  • 2021-01-07 16:54

    [Text editor screenshot ]

    development: DEV_DB_PASSWORD: 'qaz' staging: STAG_DB_PASSWORD: 'qaz'

    there should not be any space in every next line

    0 讨论(0)
  • 2021-01-07 16:58

    May not be your specific example, but the title of the Stack Overflow resulted in me being on this post so for those working with this error, it may be due to:

    en.yml or a translation yml or any yaml...

    That doesn't have double quotes around a string interpolation

    points:
      other: %{points} points
    

    Correction:

    points:
      other: "%{points} points"
    
    0 讨论(0)
  • 2021-01-07 17:02

    This error is originating from the Figaro gem, which would indicate to me that you probably have a syntax error in config/application.yml. Double check this file for any incorrect YAML syntax.

    0 讨论(0)
  • 2021-01-07 17:05

    I have the same issue with yours. I'm sure its the TAB characters (\t) issue. Please replace with 2 spaces.

    0 讨论(0)
  • 2021-01-07 17:09

    You should check all important configuration files that contains YAML. I had the same error when tried to rake db:seed, and it turns out that I had TAB character in commented block in config/database.yml.

    If you are not sure, use some online YAML parser, i.e. http://yaml-online-parser.appspot.com/.

    0 讨论(0)
提交回复
热议问题