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

发布于 2024-12-13 03:26:54 字数 1387 浏览 0 评论 0原文

在集成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>'

我在堆栈中发现了一个类似问题溢出并且接受的答案对我有用。

我不想使用 Syck,如何使用 Psych 修复它?两者的 yml 格式有什么区别吗?由于回溯没有指向任何 yaml 文件,我如何调试更多?

非常感谢任何帮助...

While integrating backgroundrb-rails3 I get the following error,

~/.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? Is there any difference in yml format for both? As the backtrace is not pointing to any yaml file, how can i debug more?

Any help is highly appreciated...

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

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

发布评论

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

评论(1

弄潮 2024-12-20 03:26:54

好吧,看起来 Psych 无法从默认配置中解析此特定行:

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

将条件括在引号中应该可以修复它:

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

您可以将默认配置复制到您的 config 文件夹中并在其中进行此更改。这是要使用的确切文件: https://raw.github .com/mtylty/backgroundrb-rails3/master/config/backgroundrb.yml

Ok, it looks like Psych can't parse this specific line from the default configuration:

: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. Here is the exact file to use: https://raw.github.com/mtylty/backgroundrb-rails3/master/config/backgroundrb.yml

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