I’m just posting this because I have been fiddling around with a Rails 1.2 application for days in utter frustration due to an obscure problem. Every time I tried to load a page, I got an error message like this:
Mon Feb 05 11:22:35 -0500 2007: Error calling Dispatcher.dispatch #<NameError: cannot remove Object::COPYRIGHT>
The name of the object that couldn’t be removed has varied. The NameError
has also caused a number of other problems that basically left my application dead. Today some searching revealed the problem. In Rails 1.2, you must put include
statements inside class definitions. I had the line:
include REXML
outside a class definition and it blew up my whole application. Fun.
This blog post is provided as a service to the next person who runs into this problem.
February 8, 2007 at 8:29 am
Wow! This tip was exactly what I needed. Tracking this down would have been very time consuming. Thanks for the tip.
March 8, 2007 at 4:44 pm
Thank you! I just nearly blew a gasket trying to figure this out. Moving the includes inside the class cured it for me.
March 10, 2007 at 12:20 am
Your tip worked for me as well. The strange thing was that although your tip fixed my problem, I hadn’t changed any of the require statements in my code in the last few days, yet the problem appeared only today. I was about to go back a few revisions to ferret out the change responsible for the problems, when I decided to do a google search instead….
Thanks a million.
April 19, 2007 at 2:52 am
i love you i love you!!! thanks. 2 days going crazy. saved by a 10 line blog entry.
June 13, 2007 at 5:38 pm
This definitely helped me track down the bizarre issue I was having. Thanks!
June 13, 2007 at 8:24 pm
Two hours of debugging, and this fixes it in two seconds. I’m thrilled, yet slightly angered :-p
July 26, 2007 at 4:34 pm
Worked like a charm. Thanks!
May 5, 2008 at 5:56 am
Thanks, that saved my a whole load of time and trouble.
May 19, 2008 at 10:23 am
Thanks! This error occurred intermittently in my case which made it particularly ugly. I spent several hours before finding your post.
May 13, 2010 at 6:44 pm
Props! Thanks!
December 18, 2011 at 10:39 am
Thank-you 🙂