繁体   English   中英

ruby脚本/ delayed_job启动的问题。 Windows上的delayed_job和守护进程

[英]problem with ruby script/delayed_job start. delayed_job and daemon on windows

得到这个错误。

  pid-file for killed process 8600 found (C:/cyncabc/tmp/pids/delayed_job.pid), deleting.
  c:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/daemonize.rb:103:in `fork': fork() function is unimplemented on this machine (NotImplementedError)
        from 
  c:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/daemonize.rb:103:in `safefork'
        from 
  c:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/daemonize.rb:145:in `call_as_daemon'
        from 
  c:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/application.rb:219:in `start_proc'
        from 
  c:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/application.rb:255:in `start'
        from 
  c:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/controller.rb:69:in `run'
        from 
  c:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons.rb:188:in `run_proc'
        from c:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/cmdline.rb:105:in `call'
        from c:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/cmdline.rb:105:in `catch_exceptions'
        from c:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons.rb:187:in `run_proc'
        from c:/ruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/command.rb:71:in `run_process'
        from c:/ruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/command.rb:65:in `daemonize'
        from c:/ruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/command.rb:63:in `times'
        from c:/ruby/lib/ruby/gems/1.8/gems/delayed_job-2.0.3/lib/delayed/command.rb:63:in `daemonize'
        from script/delayed_job:5

有没有解决这个问题的解决方案? 它与ruby脚本/ delayed_job运行正常。

该错误告诉您,Delayed Job使用的Daemons gem在Windows上不起作用,因为Windows中没有fork API( fork是UNIX / Linux系统调用)。 您需要切换到与Windows兼容的后台处理库,或切换到Linux或Mac OS X以进行Rails开发。

而不是做rake jobs:work你可以在一个单独的提示中手动启动它: ruby script/delayed_job

因为你直接调用脚本,所以没有分支到那里的背景。

希望有助于。

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM