Undefined method <name> for Service:Module

Hi all,

We have a controller by name “ServiceController” (service_controller.rb)
and everything was fine until we upgraded our rails. We recently
upgraded Rails from Rails 1.1.6 to Rails 1.2.3. and after that when we
try to invoke the “ServiceController” we are getting an error like this

“undefined method find for Service:Module”

I guess some namespace collision is happening, internally in Rails 1.2.3
is Rails also using the same name “Service” so that it invokes the Rails
“ServceController” instead of our controller. Has anybody come across
this error.

As a workaround i guess if we rename our ServceController" to some other
name it might work, but we would like to do that only as the last
alternative, is there any workaround for the above problem (or) is there
a way in Rails to fully qualify the name to ask rails to search for our
“ServiceController” instead of Rails internal?

Please help in this regard in case if have any ideas.

Thanks
Dinesh

This is what i found today after spending lot of times

I was using mongrel ?

Actually if weuse WebRICK instead of Mongrel, things should work.
‘script/server webrick’ [Force WEBrick]

If you still want to use mongrel, what i found is i had this gem
installed
“mongrel_service version 0.3.1” in my system.

I Uninstalled the above gem. Now i just have this gem in my system
“mongrel (1.0.1)”

and now i restarted my apps and it is working fine. !!!

I guess the ‘service’ in “mongrel_service version 0.3.1” is classing
with our ‘app service.’

Hope it helps somebdody.

Thanks
Dinesh

Dinesh U. wrote:

Hi all,

We have a controller by name “ServiceController” (service_controller.rb)
and everything was fine until we upgraded our rails. We recently
upgraded Rails from Rails 1.1.6 to Rails 1.2.3. and after that when we
try to invoke the “ServiceController” we are getting an error like this

“undefined method find for Service:Module”

I guess some namespace collision is happening, internally in Rails 1.2.3
is Rails also using the same name “Service” so that it invokes the Rails
“ServceController” instead of our controller. Has anybody come across
this error.

As a workaround i guess if we rename our ServceController" to some other
name it might work, but we would like to do that only as the last
alternative, is there any workaround for the above problem (or) is there
a way in Rails to fully qualify the name to ask rails to search for our
“ServiceController” instead of Rails internal?

Please help in this regard in case if have any ideas.

Thanks
Dinesh

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs