title: How can I run Rails background jobs on AWS Elastic Beanstalk?
body: <p>I just started to use <a href="https://aws.amazon.com/elasticbeanstalk/" rel="noreferrer">AWS Elastic Beanstalk</a> with my rails app and I need to use the Resque gem for background jobs. However, despite all effort to search how to run Resque worker on Elastic Beanstalk, I haven't been able to figure out how?</p>
  
  <p><a href="https://stackoverflow.com/questions/14538940/rails-background-jobs-with-resque-on-aws-elastic-beanstalk">How can I run Rails background jobs with Resque on AWS Elastic Beanstalk?</a> talks about running those as services in Elastic Beanstalk containers, however, it is still very confusing.</p>
  
  <p>Here my ebextentions resque.config file:</p>
  
  <pre><code>services: 
    sysvinit:
    resque_worker:
      enabled: true
      ensureRunning: true
      commands: 
        resque_starter: 
          rake resque:work QUEUE='*'
  </code></pre>
  
  <p><strong>EDIT</strong>
  Now my resque.config file looks like this:</p>
  
  <pre><code>container_commands:
    resque_starter: "rake resque:work QUEUE='*'"
  services: 
    sysvinit:
      resque_worker:
        enabled: true
          ensureRunning: true
        commands: 
          resque_starter
  </code></pre>
  
  <p>And it is still not working.
  <strong>EDIT 2</strong></p>
  
  <pre><code>container_commands:
    resque_starter: 
      command: "rake resque:work QUEUE=sqs_message_sender_queue"
      cwd: /var/app/current/
      ignoreErrors: true
  </code></pre>
  
  <p>Still it shows 0 workers.</p>