Uninitialized constant ActiveResource::UnauthorizedAccess

Hi,

I am getting the error “uninitialized constant
ActiveResource::UnauthorizedAccess” while executing the rails3
application.

Below are my package details:
*
*
Rails 3.0.0
Ruby 1.8.7
activeresource (3.0.0, 2.3.4)

Suggestions are welcome!

Regards,
Seeni Rafiyullah Khan A,
[email protected]In Every moment, thank God.

On 7 August 2012 09:00, Rafi A [email protected] wrote:

Suggestions are welcome!

Start with google for
ActiveResource::UnauthorizedAccess
That shows lots of hits with various suggestions as to what can cause
this. If none of those help then come back but give us some more
information about the specific call you are making that is causing the
problem. We are not telepathic.

Colin

Colin,

Thanks for your reply. Surfed over both sides of Google but not able to
get
the apt solution. I am using the below code snippet in Application
controller file so that all the flows will inherit.

‘rescue_from ActiveResource::UnauthorizedAccess, :with => :render_401’

But while invoking the application URL, I am getting the error which I
have
sent in below mail thread.

Please let me know if you have any ideas.

Regards,
Seeni Rafiyullah Khan A,
[email protected]In Every moment, thank God.

Hi,

This is resolved. I copied the ‘activeresource-3.0.0’ gem folder from
the
source folder of rails3 and pasted under the ‘config/initializers’
folder
of my rails3 application. So the below code snippet available in
application_controler.rb file is working fine as expected.

class ApplicationController < ActionController::Base
rescue_from ActiveResource::UnauthorizedAccess, :with => :render_401
end

Regards,
Seeni Rafiyullah Khan A,
[email protected]In Every moment, thank God.

On 7 August 2012 09:25, Rafi A [email protected] wrote:

Colin,

Thanks for your reply. Surfed over both sides of Google but not able to get
the apt solution. I am using the below code snippet in Application
controller file so that all the flows will inherit.

‘rescue_from ActiveResource::UnauthorizedAccess, :with => :render_401’

But while invoking the application URL, I am getting the error which I have
sent in below mail thread.

You have not shown us the code that is triggering the problem. Also
have a look in the log for the local app and the remote one and see
what is happening.

I would prefer it if you did not top post please, it makes it easier
to follow the thread. Insert your reply inline in previous message.
Thanks.

Colin

On 8 August 2012 05:57, Rafi A [email protected] wrote:

Hi,

This is resolved. I copied the ‘activeresource-3.0.0’ gem folder from the
source folder of rails3 and pasted under the ‘config/initializers’ folder of
my rails3 application. So the below code snippet available in
application_controler.rb file is working fine as expected.

class ApplicationController < ActionController::Base
rescue_from ActiveResource::UnauthorizedAccess, :with => :render_401
end

I misinterpreted your question. Sorry. What you have done should not
be necessary. Have you included activeresource in your Gemfile and
run bundle install?

Colin

On Wed, Aug 8, 2012 at 3:21 PM, Colin L. [email protected]
wrote:

rescue_from ActiveResource::UnauthorizedAccess, :with => :render_401

end

I misinterpreted your question. Sorry. What you have done should not
be necessary. Have you included activeresource in your Gemfile and
run bundle install?

Yes. Did but no luck! Finally switched over to that solution.