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

  • Home
  • SEARCH
  • 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 7053345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:29:37+00:00 2026-05-28T03:29:37+00:00

I’m struggling a bit with getting my unicorn and delayed_job processes reboot-proof. I’ve settled

  • 0

I’m struggling a bit with getting my unicorn and delayed_job processes reboot-proof. I’ve settled on using bluepill as the overall manager as this can easily be started with upstart in Ubuntu. I’ve created an RVM wrapper for bluepill and the upstart script works well (starts and stops with ease:

# bluepill - process monitor
#
# simple process monitoring tool

description "simple process monitoring tool"

start on started nginx
stop on stopping nginx

expect daemon
#respawn

exec bootup_bluepill load /home/deployer/apps/nzswarranty/current/config/production.pill

Next up comes the bluepill config file:

Bluepill.application("nzswarranty", :log_file => "/var/log/bluepill.log") do |app|
  app.working_dir = '/home/deployer/apps/nzswarranty/current'
  app.uid = "deployer"
  app.gid = "staff"

  app.process("unicorn") do |process|
    process.start_command = "bundle exec unicorn_rails -c config/unicorn.rb -D"
    process.stop_command  = "kill -s QUIT `cat /tmp/unicorn.nzswarranty.pid`"
    process.restart_command  = "kill -s USR2 `cat /tmp/unicorn.nzswarranty.pid`"
    process.pid_file = '/tmp/unicorn.nzswarranty.pid'
    process.start_grace_time = 15.seconds
    process.stop_grace_time = 15.seconds
  end

  app.process("delayed_job") do |process|
    process.environment = { 'RAILS_ENV' => 'production' }
    process.start_command = 'script/delayed_job start'
    process.stop_command  = 'script/delayed_job stop'
    process.pid_file = '/home/deployer/apps/nzswarranty/shared/pids/delayed_job.pid'
    process.start_grace_time = 15.seconds
    process.stop_grace_time = 15.seconds
  end

end

The server has system-wide RVM installed and bundler managing the gems. I should mention this is a Rails 3.1 app.

Basically when I start bluepill without delayed_job already running I get this when it tries to boot it up:

W, [2012-01-05T13:37:55.185626 #28201]  WARN -- : [nzswarranty:delayed_job] Start command execution returned non-zero exit code:
W, [2012-01-05T13:37:55.185780 #28201]  WARN -- : [nzswarranty:delayed_job] {:stdout=>"", :stderr=>"/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- bundler/setup (LoadError)\n\tfrom /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'\n\tfrom /home/deployer/apps/nzswarranty/current/config/boot.rb:6:in `<top (required)>'\n\tfrom <internal:lib/rubygems/custom_require>:29:in `require'\n\tfrom <internal:lib/rubygems/custom_require>:29:in `require'\n\tfrom /home/deployer/apps/nzswarranty/current/config/application.rb:1:in `<top (required)>'\n\tfrom <internal:lib/rubygems/custom_require>:29:in `require'\n\tfrom <internal:lib/rubygems/custom_require>:29:in `require'\n\tfrom /home/deployer/apps/nzswarranty/current/config/environment.rb:2:in `<top (required)>'\n\tfrom <internal:lib/rubygems/custom_require>:29:in `require'\n\tfrom <internal:lib/rubygems/custom_require>:29:in `require'\n\tfrom script/delayed_job:3:in `<main>'\n", :exit_code=>1}
I, [2012-01-05T13:37:55.186003 #28201]  INFO -- : [nzswarranty:delayed_job] Going from down => starting

I’ve tried using bundle exec for this also and it just says it can’t find the bundle executable. My suspicion is that the environment isn’t being loaded correctly. Any tips? I have an RVM gemset which is loaded from the .rvmrc file in the root of the project. Should I be switching to this gemset in the bluepill config also?

  • 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-28T03:29:38+00:00Added an answer on May 28, 2026 at 3:29 am

    Ok, so it was pretty easy in the end. I think what was happening is that I installed bluepill in the global rvm gemset as root and also created my wrapper to use the global gemset in the environment (meaning bluepill started ok but it didn’t see any of the other gems in my proper gemset (warranty)). I basically removed bluepill from the global gemset and installed it in the warranty gemset. I then created the wrapper again:

    rvmsudo rvm wrapper ruby-1.9.2-p290@warranty bootup bluepill
    

    I also encountered another strange error when trying to boot up unicorn but realised I wasn’t passing the RAILS_ENV in. Here’s my final .pill:

    Bluepill.application("nzswarranty", :log_file => "/var/log/bluepill.log") do |app|
        app.working_dir = '/home/deployer/apps/nzswarranty/current'
        app.uid = 'deployer'
        app.gid = 'staff'
        app.environment = { 'RAILS_ENV' => 'production' }
    
        app.process("unicorn") do |process|
            process.start_command = "bundle exec unicorn_rails -c config/unicorn.rb -D"
            process.stop_command  = "kill -s QUIT `cat /tmp/unicorn.nzswarranty.pid`"
            process.restart_command  = "kill -s USR2 `cat /tmp/unicorn.nzswarranty.pid`"
            process.pid_file = '/tmp/unicorn.nzswarranty.pid'
            process.start_grace_time = 30.seconds
            process.stop_grace_time = 30.seconds
        end
    
        app.process("delayed_job") do |process|
            process.start_command = 'bundle exec script/delayed_job start'
            process.stop_command  = 'bundle exec script/delayed_job stop'
            process.pid_file = '/home/deployer/apps/nzswarranty/shared/pids/delayed_job.pid'
            process.start_grace_time = 30.seconds
            process.stop_grace_time = 30.seconds
        end
    end
    

    It’s important to note that we need to use bundle exec before our other commands so that we’re loading up the full set of gems from the Gemfile.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build

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.