Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7660565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:29:01+00:00 2026-05-31T13:29:01+00:00

I am using a Mac OS running Snow Leopard 10.6.8, Ruby on Rails 3.2.2

  • 0

I am using a Mac OS running Snow Leopard 10.6.8, Ruby on Rails 3.2.2 and the DelayedJob gem. I would like to run some “command lines”/”tasks” from an inizializer so to start delayed workers.

In order to do that in my config/initializers/delayed_job.rb file I am trying to state the following:

if Rails.env.development?
  system 'rake jobs:work'
elsif Rails.env.production?
  system 'RAILS_ENV=production script/delayed_job stop'
  system 'RAILS_ENV=production script/delayed_job -n 2 start'
end

However, the above code will start a lot of ruby processes and those rapidly slow my machine so I have to restart that. The remote machine run Linux Ubuntu 10.4.

How can I properly state that code so to run delayed workers?

In any case I think that, since on the local and remote machine are running two different Operating System, “command lines”/”tasks” should be different, as well…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:29:02+00:00Added an answer on May 31, 2026 at 1:29 pm

    Rather than using an initializer this should be done during deployment as your initializer is run for every instance of your app that is spawned.

    Since you use capistrano I typically handle this like so:

    in config/deploy.rb:

    require 'delayed/recipes'
    
    after 'deploy:symlink', 'delayed_job:restart'
    

    Since your wanting to spawn 2 workers this could be done by setting the delayed_job_args:

    require 'delayed/recipes'
    set :delayed_job_args, "-n 2"
    after 'deploy:symlink', 'delayed_job:restart'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Apache Ruby and Ruby on Rails 3 Mac Os running Snow
I am using a Mac OS running Snow Leopard 10.6.8 and RVM 1.10.3, Ruby
I'm running Python 2.6.4 on Mac Snow Leopard. I installed pycurl using: sudo env
I'm on a Mac running 10.6.4 Snow Leopard, and apparently ruby comes ready to
I'm trying to get a Qt app compiling for Mac running Snow Leopard, using
I am using Mac OS X Leopard 10.5.8, which is running Safari 4.0.3. My
I am running Mac OSX 10.5.8. I installed matplotlib using macports. I get some
I need to run Python 2.7 on my Mac Snow Leopard, which has Python
I am on Mac OS an I am running Snow Leopard Version 10.6.8. I
I am running GCC 4.2.1 under Snow Leopard on Mac OS X. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.