# Cron and runner doesn't work anymore?

**URL:** <https://www.ruby-forum.com/t/cron-and-runner-doesnt-work-anymore/66475>\
**Category:** Rails\
**Created:** [August 26, 2006, 11:11am UTC](https://www.ruby-forum.com/t/cron-and-runner-doesnt-work-anymore/66475 "2006-08-26T11:11:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![phillyloco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/258eb7/32.png) [@phillyloco](https://www.ruby-forum.com/u/phillyloco)\
**Post date:** [August 26, 2006, 11:11am UTC](https://www.ruby-forum.com/t/cron-and-runner-doesnt-work-anymore/66475/1 "2006-08-26T11:11:59Z")

</div>

Hello,

For a number of projects I have, I use the runner and a cron job to  
run maintenance code every so often. I noticed since I updated to  
rails 1.1.6, none of my cron jobs get executed anymore. I know that  
the code still works because if I type in the line in the cron tab  
manually it runs and I also checked the cron logs and made sure that  
the runner script is called. My runner cron jobs just stopped working  
on 3 of my servers after the 1.1.6 update.

To test, I setup a small application, here is my run class:

class Run

def self.test  
puts “Hello World”  
end

end

Here is the line in my crontab:

- 
  - 
    - 
      - 
        - ruby /Users/carllerche/Developer/Ruby/test\_themes/script/  
runner “Run.test” \>\> /Users/carllerche/run.log

yet nothing happens at all. Does anybody know what’s going on?

Thanks,  
-carl

---

<div class="post-metadata">

**Author:** ![phillyloco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/258eb7/32.png) [@phillyloco](https://www.ruby-forum.com/u/phillyloco)\
**Post date:** [August 26, 2006, 11:58am UTC](https://www.ruby-forum.com/t/cron-and-runner-doesnt-work-anymore/66475/2 "2006-08-26T11:58:53Z")

</div>

> Here is the line in my crontab:
> 
> - 
> - 
> - 
> - 
> - ruby /Users/carllerche/Developer/Ruby/test\_themes/script/  
> runner “Run.test” \>\> /Users/carllerche/run.log
> 
> yet nothing happens at all. Does anybody know what’s going on?

Compare your environment variables from your shell to what cron has.  
Odds  
are cron is missing something that rails wants (and perhaps used to  
figure  
out on it’s own or something).

What does your #{RAILS\_ENV}.log say? anything?

---

<div class="post-metadata">

**Author:** ![phillyloco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/258eb7/32.png) [@phillyloco](https://www.ruby-forum.com/u/phillyloco)\
**Post date:** [August 26, 2006, 12:02pm UTC](https://www.ruby-forum.com/t/cron-and-runner-doesnt-work-anymore/66475/3 "2006-08-26T12:02:56Z")

</div>

Carl,

There was a thread not unlike this one yesterday. Might it be the  
same issue?

---

<div class="post-metadata">

**Author:** ![phillyloco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/258eb7/32.png) [@phillyloco](https://www.ruby-forum.com/u/phillyloco)\
**Post date:** [September 4, 2006, 2:46pm UTC](https://www.ruby-forum.com/t/cron-and-runner-doesnt-work-anymore/66475/4 "2006-09-04T14:46:12Z")

</div>

Another thing to note is that my cron jobs WERE running fine, then  
they just died all of a sudden and I believe that coincides with when  
I updated to 1.1.6

-carl

---

<div class="post-metadata">

**Author:** ![phillyloco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/258eb7/32.png) [@phillyloco](https://www.ruby-forum.com/u/phillyloco)\
**Post date:** [September 4, 2006, 2:46pm UTC](https://www.ruby-forum.com/t/cron-and-runner-doesnt-work-anymore/66475/5 "2006-09-04T14:46:15Z")

</div>

On Aug 25, 2006, at 7:18 PM, Philip H. wrote:

> Compare your environment variables from your shell to what cron  
> has. Odds  
> are cron is missing something that rails wants (and perhaps used to  
> figure  
> out on it’s own or something).
> 
> What does your #{RAILS\_ENV}.log say? anything?

My #{RAILS\_ENV}.log is completely empty. Which environment variables  
should I compare and how should I do it?

On Aug 25, 2006, at 6:56 PM, Zachary H. wrote:

> Carl,
> 
> There was a thread not unlike this one yesterday. Might it be the  
> same issue?

Hmmm… I tried looking but I didn’t find anything. Do you know what  
the title of the thread is?

Thanks,  
-carl

---

<div class="post-metadata">

**Author:** ![phillyloco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/258eb7/32.png) [@phillyloco](https://www.ruby-forum.com/u/phillyloco)\
**Post date:** [September 4, 2006, 2:46pm UTC](https://www.ruby-forum.com/t/cron-and-runner-doesnt-work-anymore/66475/6 "2006-09-04T14:46:24Z")

</div>

On Aug 25, 2006, at 7:05 PM, Carl L. wrote:

> Thanks,  
> -carl

‘Cron w/Rails’ is the title. The gist is to get cron to the point  
where it’s emailing you (or is otherwise giving you something you can  
read) and then have it run

which ruby

and give you the results. Then compare that output with the output  
you get by running the same command at the prompt. Did you happen to  
modify ruby in any way around the same time that you upgraded Rails?

---

<div class="post-metadata">

**Author:** ![phillyloco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/258eb7/32.png) [@phillyloco](https://www.ruby-forum.com/u/phillyloco)\
**Post date:** [September 4, 2006, 2:46pm UTC](https://www.ruby-forum.com/t/cron-and-runner-doesnt-work-anymore/66475/7 "2006-09-04T14:46:16Z")

</div>

I found the thread and it seems that it fixed it (was the path deal).  
Thanks for the tip!

-carl
