Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

HttpMock not initialized in the Rails 2.3.2 GEM

#2833

I am receiving the following error on any of my Rails projects on OSX with the Rails 2.3.2 GEM.

NameError: uninitialized constant ActiveResource::HttpMock

This can be reproduced by just opening a console as follows:

script/console
Loading development environment (Rails 2.3.2)
>> ActiveResource
=> ActiveResource
>> ActiveResource::HttpMock
NameError: uninitialized constant ActiveResource::HttpMock
    from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:440:in `load_missing_constant'
    from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing_not_from_s3_library'
    from /Library/Ruby/Gems/1.8/gems/aws-s3-0.5.1/lib/aws/s3/extensions.rb:174:in `const_missing'
    from (irb):2

Thanks,
Tom

Reported by Tom · June 24th, 2009 @ 09:06 PM

State: invalid
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Pat Nakajima
    Pat Nakajima

    Try updating your aws-s3 gem. The most recent version is 0.6.2.

    June 24th, 2009 @ 09:35 PM

  2. Tom
    Tom

    I just updated my aws-s3 gem, but no joy:

    ActiveResource::HttpMock NameError: uninitialized constant ActiveResource::HttpMock

    from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:440:in `load_missing_constant'
    from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing_not_from_s3_library'
    from /Library/Ruby/Gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:in `const_missing'
    from (irb):1
    

    Is there a reason the traceback is referencing the aws-s3 gem?

    June 24th, 2009 @ 09:38 PM

  3. Tom
    Tom

    I went ahead and uninstalled the aws-s3 gem totally just to see if it made a difference. I get the same error though:

    >> ActiveResource::HttpMock
    NameError: uninitialized constant ActiveResource::HttpMock
        from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:440:in `load_missing_constant'
        from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing'
        from (irb):1
    

    June 24th, 2009 @ 09:48 PM

  4. Tom
    Tom

    Okay, so I need to add the line:

    require 'active_resource/http_mock'
    

    That is probably just poorly documented and not a bug. Sorry!

    June 25th, 2009 @ 02:54 AM

  5. Yehuda Katz (wycats)
    Yehuda Katz (wycats)
    • State changed from new to invalid

    July 2nd, 2009 @ 07:59 PM