I actually want to activate delayed job on production mode. So I type in "
RAILS_ENV=production script/delayed_job start
" at console and Having the error at "
:dir => File.join(dir, 'tmp', 'pids'),
" that report undefined dir... search online about the original file but can't find any.
#!/usr/bin/env ruby
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment'))
require 'delayed/command'
Delayed::Command.new(ARGV).daemonize
daemon_options = {
:multiple => false,
:dir_mode => :normal,
**:dir => File.join(dir, 'tmp', 'pids'),**
:backtrace => true
}
Daemons.run_proc('job_runner', daemon_options) do
if ARGV.include?('--')
ARGV.slice! 0..ARGV.index('--')
else
ARGV.clear
end
Dir.chdir dir
RAILS_ENV = ARGV.first || ENV['RAILS_ENV'] || 'development'
require File.join('config', 'environment')
Delayed::Worker.new.start
end