Search code examples
rubyrubygemsstartupsidekiq

Start sidekiq automatically on OSX


I have coded up a small ruby gem that I use on my laptop to check disk space and other things.

I am using a sidekiq worker that runs periodically and emails me status updates.

I was wondering how to make a sidekiq worker run automatically after I restart OSX? Is this possible?

Cheers


Solution

  • To run sidekiq you need to run: bundle exec sidekiq. If you want to run this on startup then you can follow these steps:

    1. Start Automator.app;
    2. Select "Application";
    3. Click "Show library" in the toolbar (if hidden);
    4. Add "Run shell script" (from the Actions/Utilities);
    5. Add script 'bundle exec sidekiq Or cd YOUR_APP_PATH&&bundle exec sidekiq;
    6. Test it;
    7. Save it somewhere: a file called your_name.app will be created);
    8. Go to System Preferences → Accounts → Login items;

    More startup script options are here