[英]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.