简体   繁体   English

Rails 3-psych.rb-无法解析YAML

[英]Rails 3 - psych.rb - couldn't parse YAML

While integrating backgroundrb-rails3 I get the following error, 整合backgroundrb-rails3时,出现以下错误,

~/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:148:in `parse': couldn't parse YAML at line 8 column 22 (Psych::SyntaxError)
from ~/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:148:in `parse_stream'
from ~/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:119:in `parse'
from ~/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:106:in `load'
from ~/.rvm/gems/ruby-1.9.2-p290/gems/backgroundrb-rails3-1.1.6/lib/backgroundrb/bdrb_config.rb:27:in `read_config'
from ~/workspace/artbee/Trunk/script/load_worker_env.rb:25:in `<top (required)>'
from ~/.rvm/gems/ruby-1.9.2-p290/gems/packet-0.1.15/bin/packet_worker_runner:25:in `require'
from ~/.rvm/gems/ruby-1.9.2-p290/gems/packet-0.1.15/bin/packet_worker_runner:25:in `initialize'
from ~/.rvm/gems/ruby-1.9.2-p290/gems/packet-0.1.15/bin/packet_worker_runner:47:in `new'
from ~/.rvm/gems/ruby-1.9.2-p290/gems/packet-0.1.15/bin/packet_worker_runner:47:in `<top (required)>'
from ~/.rvm/gems/ruby-1.9.2-p290/bin/packet_worker_runner:19:in `load'
from ~/.rvm/gems/ruby-1.9.2-p290/bin/packet_worker_runner:19:in `<main>'

I found a similar question in stack overflow and the accepted answer works for me. 我在堆栈溢出中发现了类似的问题 ,并且可接受的答案对我有用。

I don't want to use Syck, how can i fix it with Psych? 我不想使用Syck,如何用Psych修复它? Is there any difference in yml format for both? 两者的yml格式是否有差异? As the backtrace is not pointing to any yaml file, how can i debug more? 由于回溯没有指向任何Yaml文件,我该如何调试更多?

Any help is highly appreciated... 任何帮助都受到高度赞赏...

Ok, it looks like Psych can't parse this specific line from the default configuration: 好的,看起来Psych无法从默认配置中解析此特定行:

:trigger_args: */5 * * * * * *

Wrapping the conditions in quotes should fix it: 用引号引起来的条件应该可以解决:

:trigger_args: "*/5 * * * * * *"

You can copy the default config into your config folder and make this change there. 您可以将默认配置复制到config文件夹中,然后在此处进行更改。 Here is the exact file to use: https://raw.github.com/mtylty/backgroundrb-rails3/master/config/backgroundrb.yml 这是要使用的确切文件: https : //raw.github.com/mtylty/backgroundrb-rails3/master/config/backgroundrb.yml

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 rails生成邮件psych.rb解析bug - rails generate mailer psych.rb parse bug psych.rb中的Rails服务器错误:370 - Rails Server error in psych.rb:370 Psych :: SyntaxError无法解析YAML - Psych::SyntaxError couldn't parse YAML Rails 3 - '无法解析 Yaml' - Rails 3 - 'Couldn't parse Yaml' 〜/ ruby​​-2.1.1 / lib / ruby​​ / 2.1.0 / psych.rb:370:在`parse&#39;中:( <unknown> ):映射值是…在第3行第8列(Psych :: SyntaxError) - ~/ruby-2.1.1/lib/ruby/2.1.0/psych.rb:370:in `parse': (<unknown>): mapping values are … at line 3 column 8 (Psych::SyntaxError) 在此上下文中不允许使用Capistrano映射进行部署时出现psych.rb错误 - psych.rb error when deploying with Capistrano 'mapping not allowed in this context' 红宝石/红宝石-2.0.0-p0 / lib /红宝石/2.0.0/psych.rb:205:在&#39;parse&#39;中:( <unknown> ):在第18行第3列扫描简单密钥时找不到预期的&#39;:&#39; - rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/psych.rb:205:in `parse': (<unknown>): could not find expected ':' while scanning a simple key at line 18 column 3 Rails 3简单表单错误:无法解析YAML - Rails 3 simple form error : couldn't parse YAML 获取无法解析Rails中的ruby中的YAML错误 - Getting couldn't parse YAML error in ruby on rails Psych无法解析简单的键:值对,Ruby,Yaml - Psych can't parse simple key: value pair, Ruby, Yaml
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM