3

得到这个错误。

  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​​ script/delayed_job 运行正常。

4

2 回答 2

5

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

于 2010-06-16T16:08:01.207 回答
1

rake jobs:work您可以在单独的提示中手动启动它,而不是这样做:ruby script/delayed_job

那里没有分叉到后台,因为您直接调用脚本。

希望有帮助。

于 2010-06-16T20:15:40.953 回答