# ActiveResource gem problem

**URL:** <https://www.ruby-forum.com/t/activeresource-gem-problem/109303>\
**Category:** Rails\
**Created:** [July 13, 2007, 9:37am UTC](https://www.ruby-forum.com/t/activeresource-gem-problem/109303 "2007-07-13T09:37:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmcolombet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b2d939/32.png) [@bmcolombet](https://www.ruby-forum.com/u/bmcolombet)\
**Post date:** [July 13, 2007, 9:37am UTC](https://www.ruby-forum.com/t/activeresource-gem-problem/109303/1 "2007-07-13T09:37:24Z")

</div>

Hi,

I’m trying to use ActiveResource with my Rails 1.2.3. I installed ARes  
0.9.0 with the current command:

sudo gem install --version 0.9.0 activeresource --source  
[http://gems.rubyonrails.org](http://gems.rubyonrails.org)

I inserted “require” in my environment.rb like this:

require ‘rubygems’  
require ‘active\_resource’

and without creating a ARes model, just lauching the server (mongrel),  
it fails with this error:

/opt/local/lib/ruby/gems/1.8/gems/activeresource-0.9.0/lib/active\_resource/base.rb:34:  
undefined method `attr_accessor_with_default' for #<Class:ActiveResource::Base> (NoMethodError) from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem\_original\_require’  
from  
/opt/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`require' from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require’  
from  
/opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active\_support/dependencies.rb:342:in  
`new_constants_in' from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require’  
from  
/opt/local/lib/ruby/gems/1.8/gems/activeresource-0.9.0/lib/active\_resource.rb:37  
from  
/opt/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:32:in  
`gem_original_require' from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require’  
… 30 levels…  
from  
/opt/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39  
from  
/opt/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require' from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’  
from ./script/server:3

Does anyone has experienced this type of problem ?

Regards,

–  
Benoit  
[http://donegarden.com/](http://donegarden.com/)

---

<div class="post-metadata">

**Author:** ![bmcolombet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b2d939/32.png) [@bmcolombet](https://www.ruby-forum.com/u/bmcolombet)\
**Post date:** [July 13, 2007, 9:42am UTC](https://www.ruby-forum.com/t/activeresource-gem-problem/109303/2 "2007-07-13T09:42:25Z")

</div>

On 7/13/07, Benoit C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,
> 
> I’m trying to use ActiveResource with my Rails 1.2.3. I installed ARes  
> 0.9.0 with the current command:

It requires edge rails.

–  
Rick O.  
[http://lighthouseapp.com](http://lighthouseapp.com)  
[http://weblog.techno-weenie.net](http://weblog.techno-weenie.net)  
[http://mephistoblog.com](http://mephistoblog.com)

---

<div class="post-metadata">

**Author:** ![bmcolombet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b2d939/32.png) [@bmcolombet](https://www.ruby-forum.com/u/bmcolombet)\
**Post date:** [July 13, 2007, 10:12am UTC](https://www.ruby-forum.com/t/activeresource-gem-problem/109303/3 "2007-07-13T10:12:29Z")

</div>

On 7/13/07, Rick O. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On 7/13/07, Benoit C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Hi,
> > 
> > I’m trying to use ActiveResource with my Rails 1.2.3. I installed ARes  
> > 0.9.0 with the current command:
> 
> It requires edge rails.  
> Ok.

But in Rails Cookbook, they give recipes about the use of ARes for the  
1.2 Rails version. So it should work with no?

> –  
> Rick O.  
> [http://lighthouseapp.com](http://lighthouseapp.com)  
> [http://weblog.techno-weenie.net](http://weblog.techno-weenie.net)  
> [http://mephistoblog.com](http://mephistoblog.com)
> 
> >

–  
Benoit  
[http://donegarden.com/](http://donegarden.com/)

---

<div class="post-metadata">

**Author:** ![bmcolombet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b2d939/32.png) [@bmcolombet](https://www.ruby-forum.com/u/bmcolombet)\
**Post date:** [July 14, 2007, 3:28am UTC](https://www.ruby-forum.com/t/activeresource-gem-problem/109303/4 "2007-07-14T03:28:09Z")

</div>

On 7/13/07, Benoit C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > It requires edge rails.  
> > Ok.
> 
> But in Rails Cookbook, they give recipes about the use of ARes for the  
> 1.2 Rails version. So it should work with no?

No, not out of the box. More specifically, the trunk of ARes relies  
on some of the post-1.2 changes in Active Support as well. The  
example you ran into here is one of those cases.

I’m experimenting with an approach of maintaining a local fork of  
Active Resource where I copy-n-paste the Active Support code snippets  
into lib/active\_resource.rb of my copy. So far, so good … although  
it’s hard to expect any guarantees that this will continue to work.

Craig McClanahan
