title: Rails delayed job fail after close session
body: <p>I use the delayed job gem to handle my email deliveries. It is working fine in the development and I am very happy with it. However after I deployed to the server, when I use command:</p>
  
  <pre><code>RAILS_ENV=production script/delayed_job start
  </code></pre>
  
  <p>it will be working. I've checked the log file and database, everything is fine and I can receive the mails just as I expected. However, when I exit from the server, nothing is going to happen. </p>
  
  <p>I've checked my database by using sequel pro and seen that the <strong>delayed job has created a row in the DB and after the time in the run_at column, the row would disappear, but no mails can be received</strong>. When I log in again, the delayed job process is still running, and the log is nothing strange, but I just cannot receive and email that I suppose to. I can't keep my self log in all the time. Without the delayed job, I can use the traditional way and it's working properly but slow. <strong>Why the delayed job failed after I log out of the server?</strong></p>
  
  <p>This is my delayed job setting in the config/initializers/delay_job.rb</p>
  
  <pre><code>require "bcrypt"
  
  Delayed::Worker.max_attempts = 5
  Delayed::Worker.delay_jobs = !Rails.env.test?
  Delayed::Worker.destroy_failed_jobs = false
  </code></pre>
  
  <p>P.S. I am not sure is it anything to do with the standalone passenger as I have to use different version of rails so I have to use a standalone passenger with port 3002. </p>