Saturday, September 19, 2009

Argument Error (A copy of SectionsController has been removed from the module tree but is still active!)

U have seen this error frequently in rails 2.3.3.. So what u have do is just call your controller(which is shown in the ArgumentError) explicitly in your dependent controllers.

Add this line on top inside the class:

require "_controller"

This will not throw the following error...

ArgumentError (A copy of SectionsController has been removed from the module tree but is still active!):
app/controllers/sections_controller.rb:61:in `index'
haml (2.2.2) lib/sass/plugin/rails.rb:19:in `process_without_compass'
/usr/lib/ruby/gems/1.8/gems/chriseppstein-compass-0.8.8/lib/compass/app_integration/rails/action_controller.rb:7:in `process'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'

Rendered rescues/_trace (185.0ms)
Rendered rescues/_request_and_response (0.5ms)
Rendering rescues/layout (internal_server_error)

Gem command reference for Rails

I used this link for gem command reference.... I think this may useful to u...

http://rubygems.org/read/book/1