哇——我在 11 月 5 日发布了同样的问题。所以,我至少必须走在正确的轨道上!:)
在生产模式下使用acts_as_ferret 的DelayedJob
为了帮助为问题提供更多背景信息:-我没有编写任何特殊代码。模型都有
acts_as_ferret :remote => true
ferret_server 初始化程序和往常一样:
$ cat config/ferret_server.yml
# configuration for the acts_as_ferret DRb server
# host: where to reach the DRb server (used by application processes to contact the server)
# port: which port the server should listen on
# pid_file: location of the server's pid file (relative to RAILS_ROOT)
# log_file: log file (default: RAILS_ROOT/log/ferret_server.log
# log_level: log level for the server's logger
production:
host: localhost
port: 9010
pid_file: log/ferret.pid
log_file: log/ferret_server.log
log_level: warn
我能够运行其他不修改记录但收集数据的延迟作业 - 所以延迟作业有效。这是我拥有的延迟作业生成器:
$ cat script/delayed_job
#!/usr/bin/env ruby
ENV['RAILS_ENV'] = 'production'
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment'))
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'boot'))
require 'delayed/command'
Delayed::Command.new(ARGV).daemonize