Note that there are some explanatory texts on larger screens.

plurals
  1. POrunning delayed_job under monit with ubuntu
    primarykey
    data
    text
    <p>I'm struggling to get delayed_job working under rails 3.0.9 (ruby 1.9.2). The only way I have succeeded to run is to tape manualy the command rake jobs:work. But I want that to be automatically started when the rails application is starting.</p> <p>I have installed monit under ubuntu and I configured it to launch a file located in my app. This fails looks like:</p> <pre><code>check process delayed_job with pidfile /home/me/myapp/tmp/pids/delayed_job.pid start program = "/home/me/myapp/script/delayed_job start" stop program = "/home/me/myapp/script/delayed_job stop" </code></pre> <p>And I added the environment setting in the delayed_job script file:</p> <pre><code>#!/usr/bin/env ruby ENV['RAILS_ENV'] = "development" require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment')) require 'delayed/command' Delayed::Command.new(ARGV).daemonize </code></pre> <p>When I run the command "sudo monit start delayed_job" I get the following error:</p> <pre><code>/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- bundler/setup (LoadError) </code></pre> <p>So I guess it is because sudo is using a wrong version of ruby environment I tried then the solution of: <a href="https://stackoverflow.com/questions/6298061/rvm-monit-delayed-job">rvm monit delayed_job</a></p> <p>by adding rvm -S in the start program / stop program lines. But it still failing with the error : rvm command not found</p> <p>my rvm dir is located in my home dir /home/me/.rvm</p> <p>I tried to find workarounds in (<a href="https://stackoverflow.com/questions/257616/sudo-changes-path-why">sudo changes PATH - why?</a>) to change the PATH environment variable by adding</p> <pre><code>/usr/bin/env PATH=/home/me/.rvm/bin:$PATH </code></pre> <p>The command "sudo monit start delayed_job" succeeded! and the worker started. But the issue is: When I launch sudo /etc/init.d/monit start and when I look to the syslog I still get <strong>'delayed_job' failed to start</strong></p> <p>So I don't know how to investigate more, how to get more verbose errors for monit.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload