<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>John Yerhot - Weblog &#187; top</title>
	<atom:link href="http://www.johnyerhot.com/tag/top/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.johnyerhot.com</link>
	<description>im in ur computrz makin castz</description>
	<lastBuildDate>Tue, 29 Jun 2010 04:32:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Debugging Backgroundrb</title>
		<link>http://www.johnyerhot.com/2008/02/11/debugging-backgroundrb/</link>
		<comments>http://www.johnyerhot.com/2008/02/11/debugging-backgroundrb/#comments</comments>
		<pubDate>Mon, 11 Feb 2008 17:34:20 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[backgroundrb]]></category>
		<category><![CDATA[mongrel]]></category>
		<category><![CDATA[top]]></category>

		<guid isPermaLink="false">http://www.johnyerhot.com/2008/02/11/debugging-backgroundrb/</guid>
		<description><![CDATA[Backgroundrb is a great tool for getting cron like functionality in your Rails app, but it can be a pain if its not working correctly.  I&#8217;m not going to go into how to get backgroundrb working, its rubyforge page has decent instructions for that, but what I will share are some tips on debugging [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://backgroundrb.rubyforge.org/">Backgroundrb</a> is a great tool for getting <a href="http://en.wikipedia.org/wiki/Crontab">cron</a> like functionality in your Rails app, but it can be a pain if its not working correctly.  I&#8217;m not going to go into how to get backgroundrb working, <a href="http://backgroundrb.rubyforge.org/">its rubyforge page</a> has decent instructions for that, but what I will share are some tips on debugging a non-working worker.</p>
<p>Obviously check your RAILS_ROOT/log and check backgroundrb.log, backgroundrb_server.log, and backgroundrb_debug.log.  I&#8217;ve found backgroundrb.log most useful, but many times I&#8217;ll restart backgroundrb by</p>
<blockquote><p> script/backgroundrb stop</p>
<p>script/backgroundrb  start #restart doesn&#8217;t work for me</p></blockquote>
<p>and nothing will happen.  Check your backgroundrb_server.log file and you may see that the &#8216;address is already in use&#8221;.</p>
<p>Type &#8220;top&#8221; into your command line (on a Linux system) and then press shift+M.  You should get a nice list of services running and you&#8217;ll more than likely have a couple of rubys on there.  For some reason backgroundrb doesn&#8217;t stop all the time when you tell it to and I&#8217;ve had to kill -9 the rubys and then restart backgroundrb and mongrel.</p>
<p>You may also notice that the backgroundrb ruby instance uses ALOT of memory!  Make sure you have</p>
<blockquote><p> :environment: production</p></blockquote>
<p>in your backgroundrb.yml file in RAILS_ROOT/config.  Otherwise backgroundrb is working in development mode.</p>
<p>Finally, to debug an syntax or other error try this.</p>
<p>1. open 2 command lines.</p>
<p>2. start your rails app with ruby script/server.  Make sure to start it in development mode and not using mongrel_rails.</p>
<p>3. start backgroundrb in the other terminal.</p>
<p>4. watch the first terminal and you can see what background rb is doing and where exactly it gets messed up.</p>
<p>You can do this by monitoring the log file or tailing it, but I like this better and it provides you with more info.</p>
<p>Hope this helps any of you out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnyerhot.com/2008/02/11/debugging-backgroundrb/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
