本文介绍了Delayed_job:作业无法加载:未初始化的常量Syck :: Syck的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是错误:

>> Delayed::Job.find(:last).last_error
=> {Job failed to load: uninitialized constant Syck::Syck. Handler: \"--- !ruby/struct:Delayed::PerformableMethod \\nobject: &id007 !ruby/object:TryController \\n  _action_name: create

但我已安装syck ext。

but I have syck ext installed.

用法:

def create_user(name,pass,time)
  puts "hello"
  Net::HTTP.get(URI.parse("http://www.example.net/buildtest.php?hao=#{name}&mi=#{pass}&da=#{time}"))
end

def create
   delay.create_user("nihao000oei9","1","1")
end

gem'delayed_job','2.1.4'

gem 'delayed_job', '2.1.4'

红宝石1.9.2p0(2010-08-18修订版29036)[x86_64-darwin10 .4.0]

ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]

Rails 3.0.1

Rails 3.0.1

谢谢。

推荐答案

当我从Rails 2升级到3并部署到Heroku Cedar堆栈时,我发现这是一个问题。 Delayed_Job 尝试从Job队列项中反序列化处理程序。默认情况下,它使用 Syck YAML

I found this as an issue when I upgraded from Rails 2 to 3 and deployed to the Heroku Cedar stack. It's an issue when Delayed_Job attempts to deserialise the handler from the Job queue item. By default it uses the Syck YAML parser.

结果 Syck 在Heroku Cedar堆栈上不可用。

Turns out Syck isn't available on the Heroku Cedar stack.

包括 Psych 宝石并重新部署为我修复了它,并允许我重新调用失败的作业。

Including the Psych gem and redeploying fixed it for me and allow me to re-invoke the failed jobs.

gem 'psych'

这篇关于Delayed_job:作业无法加载:未初始化的常量Syck :: Syck的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-23 18:30