<?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>Hank Beaver &#187; error</title>
	<atom:link href="http://www.hankbeaver.com/index.php/tag/error/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hankbeaver.com</link>
	<description>Open-source, Internet technologist who works for MaxMedia located in Atlanta, GA, USA</description>
	<lastBuildDate>Tue, 09 Aug 2011 18:20:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Mysql::Error: MySQL server has gone away with Sinatra + ActiveRecord</title>
		<link>http://www.hankbeaver.com/index.php/2009/08/10/mysqlerror-mysql-server-has-gone-away-with-sinatra-activerecord/</link>
		<comments>http://www.hankbeaver.com/index.php/2009/08/10/mysqlerror-mysql-server-has-gone-away-with-sinatra-activerecord/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 17:17:12 +0000</pubDate>
		<dc:creator>hbeaver</dc:creator>
				<category><![CDATA[activerecord]]></category>
		<category><![CDATA[sinatra]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[thin]]></category>

		<guid isPermaLink="false">http://www.rubyslacker.com/?p=98</guid>
		<description><![CDATA[When working with Sinatra + ActiveRecord + MySQL running on the venerable Thin server, you are probably going to see the error after 8 hours(MySQL default connection timeout):  &#8220;Mysql::Error: MySQL server has gone away&#8221; message. The resolution is pretty simple: 

class NewApp < Sinatra::Default   

  before do
    ActiveRecord::Base.connection.verify!
 [...]]]></description>
			<content:encoded><![CDATA[<p>When working with Sinatra + ActiveRecord + MySQL running on the venerable <a href="http://code.macournoyer.com/thin/">Thin</a> server, you are probably going to see the error after 8 hours(MySQL default connection timeout):  &#8220;Mysql::Error: MySQL server has gone away&#8221; message. The resolution is pretty simple: </p>
<pre>
class NewApp < Sinatra::Default   

  before do
    ActiveRecord::Base.connection.verify!
  end
...
end #end of Sinatra class
</pre>
<p>I created a Lighthouse ticket before I discovered the resolution. There are also more technical details here: <a href="https://thin.lighthouseapp.com/projects/7212-thin/tickets/101-activerecord-connection-does-not-reconnect-when-using-thinsinatra-but-works-fine-with-just-sinatra#ticket-101-4">https://thin.lighthouseapp.com/projects/7212-thin/tickets/101-activerecord-connection-does-not-reconnect-when-using-thinsinatra-but-works-fine-with-just-sinatra#ticket-101-4</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hankbeaver.com/index.php/2009/08/10/mysqlerror-mysql-server-has-gone-away-with-sinatra-activerecord/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calling initialize in ActiveRecord model causes nil.has_keys? error.</title>
		<link>http://www.hankbeaver.com/index.php/2008/09/02/calling-initialize-in-activerecord-model-causes-nilhas_keys-error/</link>
		<comments>http://www.hankbeaver.com/index.php/2008/09/02/calling-initialize-in-activerecord-model-causes-nilhas_keys-error/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 13:24:35 +0000</pubDate>
		<dc:creator>hbeaver</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[has_keys?]]></category>
		<category><![CDATA[model]]></category>

		<guid isPermaLink="false">http://1000fires.com/wordpress/?p=43</guid>
		<description><![CDATA[When instantiating a model class this error occurs:
instance = MyModel.new
NoMethodError: You have a nil object when you didn't expect it!
The error occurred while evaluating nil.has_key?
This is rectified by placing a super within model class.
def initialize
super
logger.debug("initialize VirtualMta: #{self.class}")
end
]]></description>
			<content:encoded><![CDATA[<p>When instantiating a model class this error occurs:</p>
<pre>instance = MyModel.new</pre>
<pre>NoMethodError: You have a nil object when you didn't expect it!</pre>
<pre>The error occurred while evaluating nil.has_key?</pre>
<p>This is rectified by placing a <strong>super</strong> within model class.</p>
<pre>def initialize</pre>
<pre>super</pre>
<pre>logger.debug("initialize VirtualMta: #{self.class}")</pre>
<pre>end</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.hankbeaver.com/index.php/2008/09/02/calling-initialize-in-activerecord-model-causes-nilhas_keys-error/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

