<?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/"
		>
<channel>
	<title>Comments on: Can&#8217;t dup NilClass&#8230; maybe try `unloadable`</title>
	<atom:link href="http://strd6.com/2009/04/cant-dup-nilclass-maybe-try-unloadable/feed/" rel="self" type="application/rss+xml" />
	<link>http://strd6.com/2009/04/cant-dup-nilclass-maybe-try-unloadable/</link>
	<description>It is beyond anything you have ever experienced or imagined</description>
	<lastBuildDate>Tue, 31 Aug 2010 19:37:37 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Abdo</title>
		<link>http://strd6.com/2009/04/cant-dup-nilclass-maybe-try-unloadable/comment-page-1/#comment-3892</link>
		<dc:creator>Abdo</dc:creator>
		<pubDate>Sun, 01 Aug 2010 09:22:52 +0000</pubDate>
		<guid isPermaLink="false">http://strd6.com/?p=250#comment-3892</guid>
		<description>I used Kris fix in the plugin init.rb and it fixed the problem and the &quot;A copy of ApplicationController has been removed from the module tree but is still active!&quot; has gone.
Thanks Kris &amp; Daniel</description>
		<content:encoded><![CDATA[<p>I used Kris fix in the plugin init.rb and it fixed the problem and the &#8220;A copy of ApplicationController has been removed from the module tree but is still active!&#8221; has gone.<br />
Thanks Kris &amp; Daniel</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nathan Hyde</title>
		<link>http://strd6.com/2009/04/cant-dup-nilclass-maybe-try-unloadable/comment-page-1/#comment-2603</link>
		<dc:creator>Nathan Hyde</dc:creator>
		<pubDate>Tue, 01 Jun 2010 18:56:46 +0000</pubDate>
		<guid isPermaLink="false">http://strd6.com/?p=250#comment-2603</guid>
		<description>Just wanted to add yet another method of addressing this issue (when all the others don&#039;t seem to work for you). Credit goes to James Adam for pointing me in the right direction and the comments in this article.

See http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/f54f18f4d4354926?pli=1 for an explanation.

In environment.rb:
&lt;code&gt;
Rails::Initializer.run do &#124;config&#124;
  # etc 
  config.to_prepare do
    # use load to ensure the added functionality is actually evaluated every time
    load &#039;path/to/your/extension.rb&#039;
  end
end
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Just wanted to add yet another method of addressing this issue (when all the others don&#8217;t seem to work for you). Credit goes to James Adam for pointing me in the right direction and the comments in this article.</p>
<p>See <a href="http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/f54f18f4d4354926?pli=1" rel="nofollow">http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/f54f18f4d4354926?pli=1</a> for an explanation.</p>
<p>In environment.rb:<br />
<code><br />
Rails::Initializer.run do |config|<br />
  # etc<br />
  config.to_prepare do<br />
    # use load to ensure the added functionality is actually evaluated every time<br />
    load 'path/to/your/extension.rb'<br />
  end<br />
end<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel X Moore</title>
		<link>http://strd6.com/2009/04/cant-dup-nilclass-maybe-try-unloadable/comment-page-1/#comment-1763</link>
		<dc:creator>Daniel X Moore</dc:creator>
		<pubDate>Fri, 26 Mar 2010 17:50:58 +0000</pubDate>
		<guid isPermaLink="false">http://strd6.com/?p=250#comment-1763</guid>
		<description>Thanks Evan! That&#039;s a better explanation and makes a lot of sense. I&#039;ll try it that way the next time I encounter the issue.</description>
		<content:encoded><![CDATA[<p>Thanks Evan! That&#8217;s a better explanation and makes a lot of sense. I&#8217;ll try it that way the next time I encounter the issue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kris</title>
		<link>http://strd6.com/2009/04/cant-dup-nilclass-maybe-try-unloadable/comment-page-1/#comment-1762</link>
		<dc:creator>Kris</dc:creator>
		<pubDate>Fri, 26 Mar 2010 13:44:27 +0000</pubDate>
		<guid isPermaLink="false">http://strd6.com/?p=250#comment-1762</guid>
		<description>@Fred - in my case the init.rb in my plugin as that is where I was getting the error. It maybe different if you are getting the error for your Rails app itself...</description>
		<content:encoded><![CDATA[<p>@Fred &#8211; in my case the init.rb in my plugin as that is where I was getting the error. It maybe different if you are getting the error for your Rails app itself&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evan Owen</title>
		<link>http://strd6.com/2009/04/cant-dup-nilclass-maybe-try-unloadable/comment-page-1/#comment-1743</link>
		<dc:creator>Evan Owen</dc:creator>
		<pubDate>Wed, 24 Mar 2010 20:31:12 +0000</pubDate>
		<guid isPermaLink="false">http://strd6.com/?p=250#comment-1743</guid>
		<description>Actually, the real cause of this problem is that ActiveRecord also defines self.included, and since you&#039;re not calling &quot;super&quot; inside your method, ActiveRecord never gets the call and can&#039;t finish loading your model, causing the &quot;can&#039;t dup nil&quot; errors when you try to call the association.

To fix this, simply do:

def self.included(account)
    account.class_eval do
        has_many :characters
    end
    super  # fixes the &quot;can&#039;t dup nil&quot; issue
end</description>
		<content:encoded><![CDATA[<p>Actually, the real cause of this problem is that ActiveRecord also defines self.included, and since you&#8217;re not calling &#8220;super&#8221; inside your method, ActiveRecord never gets the call and can&#8217;t finish loading your model, causing the &#8220;can&#8217;t dup nil&#8221; errors when you try to call the association.</p>
<p>To fix this, simply do:</p>
<p>def self.included(account)<br />
    account.class_eval do<br />
        has_many :characters<br />
    end<br />
    super  # fixes the &#8220;can&#8217;t dup nil&#8221; issue<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: xain</title>
		<link>http://strd6.com/2009/04/cant-dup-nilclass-maybe-try-unloadable/comment-page-1/#comment-1213</link>
		<dc:creator>xain</dc:creator>
		<pubDate>Wed, 23 Dec 2009 15:20:10 +0000</pubDate>
		<guid isPermaLink="false">http://strd6.com/?p=250#comment-1213</guid>
		<description>I still get the problem, and I don&#039;t know how to fix it. The solutions listed above cannot fix it. The only option I can choose now is to downgrade to rails 2.2.2</description>
		<content:encoded><![CDATA[<p>I still get the problem, and I don&#8217;t know how to fix it. The solutions listed above cannot fix it. The only option I can choose now is to downgrade to rails 2.2.2</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: crackertime</title>
		<link>http://strd6.com/2009/04/cant-dup-nilclass-maybe-try-unloadable/comment-page-1/#comment-1205</link>
		<dc:creator>crackertime</dc:creator>
		<pubDate>Sun, 20 Dec 2009 04:20:10 +0000</pubDate>
		<guid isPermaLink="false">http://strd6.com/?p=250#comment-1205</guid>
		<description>Snap this started happening today after I updated my XUbuntu system to the latest.  I guess the process fudged my rails files.  I am not using engines.  Maybe it is because I have a model named User?  What gives?  I don&#039;t want to go around putting some crazy ass line like unloadable in all my models.  That is just stupid in my opinion.</description>
		<content:encoded><![CDATA[<p>Snap this started happening today after I updated my XUbuntu system to the latest.  I guess the process fudged my rails files.  I am not using engines.  Maybe it is because I have a model named User?  What gives?  I don&#8217;t want to go around putting some crazy ass line like unloadable in all my models.  That is just stupid in my opinion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Felix</title>
		<link>http://strd6.com/2009/04/cant-dup-nilclass-maybe-try-unloadable/comment-page-1/#comment-1185</link>
		<dc:creator>Felix</dc:creator>
		<pubDate>Thu, 10 Dec 2009 12:21:51 +0000</pubDate>
		<guid isPermaLink="false">http://strd6.com/?p=250#comment-1185</guid>
		<description>@Brad: Ta, my messages were also caused by an unnecessary &quot;require &#039;user&#039;&quot; in a file in the lib folder.  After removing the &quot;require &#039;user&#039;&quot; the problem went away.  Another problem that went away when I did this was before_update being called twice in test mode (http://dev.rubyonrails.org/ticket/480).</description>
		<content:encoded><![CDATA[<p>@Brad: Ta, my messages were also caused by an unnecessary &#8220;require &#8216;user&#8217;&#8221; in a file in the lib folder.  After removing the &#8220;require &#8216;user&#8217;&#8221; the problem went away.  Another problem that went away when I did this was before_update being called twice in test mode (<a href="http://dev.rubyonrails.org/ticket/480" rel="nofollow">http://dev.rubyonrails.org/ticket/480</a>).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan</title>
		<link>http://strd6.com/2009/04/cant-dup-nilclass-maybe-try-unloadable/comment-page-1/#comment-1172</link>
		<dc:creator>Stefan</dc:creator>
		<pubDate>Fri, 04 Dec 2009 12:35:40 +0000</pubDate>
		<guid isPermaLink="false">http://strd6.com/?p=250#comment-1172</guid>
		<description>thank you so much!
@Gary: I&#039;m using 2.3.4 and I had the same problem.</description>
		<content:encoded><![CDATA[<p>thank you so much!<br />
@Gary: I&#8217;m using 2.3.4 and I had the same problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: @akorshkov</title>
		<link>http://strd6.com/2009/04/cant-dup-nilclass-maybe-try-unloadable/comment-page-1/#comment-1041</link>
		<dc:creator>@akorshkov</dc:creator>
		<pubDate>Wed, 21 Oct 2009 14:11:07 +0000</pubDate>
		<guid isPermaLink="false">http://strd6.com/?p=250#comment-1041</guid>
		<description>Thanks, thanks, thanks!
Writing code is a pleasure again :)</description>
		<content:encoded><![CDATA[<p>Thanks, thanks, thanks!<br />
Writing code is a pleasure again <img src='http://strd6.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
