<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: How to Execute a Rails Controller Action via. Cron</title>
	<atom:link href="http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/feed/" rel="self" type="application/rss+xml" />
	<link>http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/</link>
	<description></description>
	<lastBuildDate>Wed, 19 Aug 2009 23:05:03 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Rails Snippets</title>
		<link>http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/#comment-402</link>
		<dc:creator>Rails Snippets</dc:creator>
		<pubDate>Wed, 25 Feb 2009 10:28:35 +0000</pubDate>
		<guid isPermaLink="false">http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/#comment-402</guid>
		<description>[...] I found an interesting site on the Web: http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/  [...]</description>
		<content:encoded><![CDATA[<p>[...] I found an interesting site on the Web: http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/  [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rails Snippets</title>
		<link>http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/#comment-401</link>
		<dc:creator>Rails Snippets</dc:creator>
		<pubDate>Wed, 25 Feb 2009 10:12:17 +0000</pubDate>
		<guid isPermaLink="false">http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/#comment-401</guid>
		<description>[...] small snippets of code or links that I do like to remember during everyday work&#8230;I found: How to Execute a Rails Controller Action via CronTweaking it a little bit resp. using it in my code (from a sub directory $RAILS_HOME/tools)require [...]</description>
		<content:encoded><![CDATA[<p>[...] small snippets of code or links that I do like to remember during everyday work&#8230;I found: How to Execute a Rails Controller Action via CronTweaking it a little bit resp. using it in my code (from a sub directory $RAILS_HOME/tools)require [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SteveJ</title>
		<link>http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/#comment-388</link>
		<dc:creator>SteveJ</dc:creator>
		<pubDate>Thu, 24 Jul 2008 18:17:43 +0000</pubDate>
		<guid isPermaLink="false">http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/#comment-388</guid>
		<description>Well... This only works for the default environment.  If you try to change the environment with a -e argument, the require seems to load a different runner and fails when it tries to parse the -e option.  Solution: set the default environment as you are good to go...

/usr/bin/env RAILS_ENV=production /usr/bin/ruby ....</description>
		<content:encoded><![CDATA[<p>Well&#8230; This only works for the default environment.  If you try to change the environment with a -e argument, the require seems to load a different runner and fails when it tries to parse the -e option.  Solution: set the default environment as you are good to go&#8230;</p>
<p>/usr/bin/env RAILS_ENV=production /usr/bin/ruby &#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SteveJ</title>
		<link>http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/#comment-387</link>
		<dc:creator>SteveJ</dc:creator>
		<pubDate>Tue, 22 Jul 2008 16:25:55 +0000</pubDate>
		<guid isPermaLink="false">http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/#comment-387</guid>
		<description>For what its worth, you can put the &quot;require ...&quot; line in the script runner line.


E.g., ruby script/runner &quot;require &#039;action_controller/integration&#039;; app = ActionController::Integration::Session.new; app.get(&#039;account/send_newsletters&#039;);&quot;</description>
		<content:encoded><![CDATA[<p>For what its worth, you can put the &#8220;require &#8230;&#8221; line in the script runner line.</p>
<p>E.g., ruby script/runner &#8220;require &#8216;action_controller/integration&#8217;; app = ActionController::Integration::Session.new; app.get(&#8216;account/send_newsletters&#8217;);&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nir</title>
		<link>http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/#comment-383</link>
		<dc:creator>Nir</dc:creator>
		<pubDate>Fri, 14 Mar 2008 17:52:39 +0000</pubDate>
		<guid isPermaLink="false">http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/#comment-383</guid>
		<description>Save me quite a bit more than &quot;couple of minutes&quot; :) Thanks!</description>
		<content:encoded><![CDATA[<p>Save me quite a bit more than &#8220;couple of minutes&#8221; <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: QuangN</title>
		<link>http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/#comment-381</link>
		<dc:creator>QuangN</dc:creator>
		<pubDate>Tue, 11 Mar 2008 11:21:29 +0000</pubDate>
		<guid isPermaLink="false">http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/#comment-381</guid>
		<description>hi all, I want to call the function from application.rb when executing runner but it doesn work with: ApplicationController.function(). Please help me on this.</description>
		<content:encoded><![CDATA[<p>hi all, I want to call the function from application.rb when executing runner but it doesn work with: ApplicationController.function(). Please help me on this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sintaks</title>
		<link>http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/#comment-294</link>
		<dc:creator>sintaks</dc:creator>
		<pubDate>Mon, 19 Nov 2007 20:53:07 +0000</pubDate>
		<guid isPermaLink="false">http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/#comment-294</guid>
		<description>Hello!

I was having problems with the Rails gem not being found. Turns out, although Ade&#039;s comment got me almost there, I still had to set my GEM_PATH. 

GEM_HOME is where RubyGems writes to, but GEM_PATH is where gem (and therefore Rails, when rubygems in included) reads from. 

My final ended up looking like this:

export PATH=$PATH:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/deploy/bin:/usr/sbin:/sbin
export RUBYLIB=$RUBYLIB:/usr/lib/site_ruby/1.8

export GEM_HOME=$GEM_HOME:/usr/lib/ruby/gems/1.8/gems
export GEM_PATH=$GEM_PATH:/usr/lib/ruby/gems/1.8

# This is how I figured out it was broken:
#gem query

cd /var/www/apps/bunnies/current

echo &quot;Doing work...&quot;
# Output is not important, as it&#039;s non-informative. Check production.log in the app
./script/runner -e production &#039;Model.some_method&#039; &gt; /dev/null
echo &quot;Done.&quot;</description>
		<content:encoded><![CDATA[<p>Hello!</p>
<p>I was having problems with the Rails gem not being found. Turns out, although Ade&#8217;s comment got me almost there, I still had to set my GEM_PATH. </p>
<p>GEM_HOME is where RubyGems writes to, but GEM_PATH is where gem (and therefore Rails, when rubygems in included) reads from. </p>
<p>My final ended up looking like this:</p>
<p>export PATH=$PATH:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/deploy/bin:/usr/sbin:/sbin<br />
export RUBYLIB=$RUBYLIB:/usr/lib/site_ruby/1.8</p>
<p>export GEM_HOME=$GEM_HOME:/usr/lib/ruby/gems/1.8/gems<br />
export GEM_PATH=$GEM_PATH:/usr/lib/ruby/gems/1.8</p>
<p># This is how I figured out it was broken:<br />
#gem query</p>
<p>cd /var/www/apps/bunnies/current</p>
<p>echo &#8220;Doing work&#8230;&#8221;<br />
# Output is not important, as it&#8217;s non-informative. Check production.log in the app<br />
./script/runner -e production &#8216;Model.some_method&#8217; &gt; /dev/null<br />
echo &#8220;Done.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: donegarden</title>
		<link>http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/#comment-286</link>
		<dc:creator>donegarden</dc:creator>
		<pubDate>Sun, 28 Oct 2007 19:52:24 +0000</pubDate>
		<guid isPermaLink="false">http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/#comment-286</guid>
		<description>Thanks for this tip. It helps me a lot.</description>
		<content:encoded><![CDATA[<p>Thanks for this tip. It helps me a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Foton</title>
		<link>http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/#comment-227</link>
		<dc:creator>Foton</dc:creator>
		<pubDate>Fri, 24 Aug 2007 07:32:42 +0000</pubDate>
		<guid isPermaLink="false">http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/#comment-227</guid>
		<description>Me too, but I&#039;m faster &quot;Finished in 0.0 seconds&quot; .

D:\SmartUver&gt;ruby script/runner --verbose=verbose &quot;app = ActionController::Integration::Session.new; app.get &#039;zadosti/predschvaleni_novych_zadosti&#039;&quot;

Loaded suite script/runner
Started

Finished in 0.0 seconds.

0 tests, 0 assertions, 0 failures, 0 errors


And nothing happens (Rails 1.2.3 on WinXP)</description>
		<content:encoded><![CDATA[<p>Me too, but I&#8217;m faster &#8220;Finished in 0.0 seconds&#8221; .</p>
<p>D:\SmartUver&gt;ruby script/runner &#8211;verbose=verbose &#8220;app = ActionController::Integration::Session.new; app.get &#8216;zadosti/predschvaleni_novych_zadosti&#8217;&#8221;</p>
<p>Loaded suite script/runner<br />
Started</p>
<p>Finished in 0.0 seconds.</p>
<p>0 tests, 0 assertions, 0 failures, 0 errors</p>
<p>And nothing happens (Rails 1.2.3 on WinXP)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Klian</title>
		<link>http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/#comment-156</link>
		<dc:creator>Klian</dc:creator>
		<pubDate>Fri, 03 Aug 2007 11:03:13 +0000</pubDate>
		<guid isPermaLink="false">http://matthall.wordpress.com/2006/12/06/how-to-execute-a-rails-controller-action-via-cron/#comment-156</guid>
		<description>Ive tried it without luck. The output is:

Loaded suite ./script/runner
Started

Finished in 0.000191 seconds.

0 tests, 0 assertions, 0 failures, 0 errors

And none happens</description>
		<content:encoded><![CDATA[<p>Ive tried it without luck. The output is:</p>
<p>Loaded suite ./script/runner<br />
Started</p>
<p>Finished in 0.000191 seconds.</p>
<p>0 tests, 0 assertions, 0 failures, 0 errors</p>
<p>And none happens</p>
]]></content:encoded>
	</item>
</channel>
</rss>
