# ActiveResource with Rails 1.2.x?

**URL:** <https://www.ruby-forum.com/t/activeresource-with-rails-1-2-x/105606>\
**Category:** Rails\
**Created:** [May 31, 2007, 4:59pm UTC](https://www.ruby-forum.com/t/activeresource-with-rails-1-2-x/105606 "2007-05-31T16:59:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![linus1412](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e68b1a/32.png) [@linus1412](https://www.ruby-forum.com/u/linus1412)\
**Post date:** [May 31, 2007, 4:59pm UTC](https://www.ruby-forum.com/t/activeresource-with-rails-1-2-x/105606/1 "2007-05-31T16:59:27Z")

</div>

Hi,

Is it possible to use ActiveResource with Rails 1.2.x ?

I’ve seen that you can download it as a source gem (gem install  
activeresource-source [http://gems.rubyonrails.org](http://gems.rubyonrails.org))

I’d love to hear from anybody who has tried this, or even better,  
somebody who has got this working.

Martin

---

<div class="post-metadata">

**Author:** ![linus1412](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e68b1a/32.png) [@linus1412](https://www.ruby-forum.com/u/linus1412)\
**Post date:** [May 31, 2007, 5:03pm UTC](https://www.ruby-forum.com/t/activeresource-with-rails-1-2-x/105606/2 "2007-05-31T17:03:28Z")

</div>

On 5/31/07, linus1412 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,
> 
> Is it possible to use ActiveResource with Rails 1.2.x ?
> 
> I’ve seen that you can download it as a source gem (gem install  
> activeresource-source [http://gems.rubyonrails.org](http://gems.rubyonrails.org))
> 
> I’d love to hear from anybody who has tried this, or even better,  
> somebody who has got this working.

Probably not, I think there were some changes to ActiveSupport to uh…  
support it. Upgrading to edge rails shouldn’t be too difficult from  
Rails 1.2.3 though…

–  
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:** ![linus1412](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e68b1a/32.png) [@linus1412](https://www.ruby-forum.com/u/linus1412)\
**Post date:** [May 31, 2007, 5:14pm UTC](https://www.ruby-forum.com/t/activeresource-with-rails-1-2-x/105606/3 "2007-05-31T17:14:30Z")

</div>

Just the man…

Thanks for the quick response Rick. When I did the gem install for  
ARes it updated ASup (have I just made this one up?) to the dependent  
version. I then had to make ARes active, but hit errors as Rails then  
wants to find the rest of Rails in vendor/rails.

The reason I say ‘Just the man’ is because I’m trying to call an  
instance of your lovely Beast from my existing app, to dynamically  
create forums, topics and posts.

I guess I’ll just have to hand cruft the REST calls to Beast for now  
then.

Shame.

Thanks,

Martin

---

<div class="post-metadata">

**Author:** ![linus1412](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e68b1a/32.png) [@linus1412](https://www.ruby-forum.com/u/linus1412)\
**Post date:** [May 31, 2007, 5:16pm UTC](https://www.ruby-forum.com/t/activeresource-with-rails-1-2-x/105606/4 "2007-05-31T17:16:31Z")

</div>

Sorry - should have pointed out that Edge is out of the question, as  
my app is already in production.

---

<div class="post-metadata">

**Author:** ![linus1412](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e68b1a/32.png) [@linus1412](https://www.ruby-forum.com/u/linus1412)\
**Post date:** [May 31, 2007, 5:28pm UTC](https://www.ruby-forum.com/t/activeresource-with-rails-1-2-x/105606/5 "2007-05-31T17:28:33Z")

</div>

On 5/31/07, linus1412 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Sorry - should have pointed out that Edge is out of the question, as  
> my app is already in production.

My apps are on edge too :o It works out if you have good tests and  
you don’t blindly bump the edge version.

–  
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:** ![linus1412](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e68b1a/32.png) [@linus1412](https://www.ruby-forum.com/u/linus1412)\
**Post date:** [May 31, 2007, 6:13pm UTC](https://www.ruby-forum.com/t/activeresource-with-rails-1-2-x/105606/6 "2007-05-31T18:13:39Z")

</div>

Hi Jason,

I tried what you suggested, but when I try to create one of my ARes  
objects in the console I get:

f = Forum.new  
NameError: uninitialized constant ActiveResource  
from ./script/…/config/…/config/…/vendor/rails/activerecord/  
lib/…/…/activesupport/lib/active\_support/dependencies.rb:266:in  
`load_missing_constant' from ./script/../config/../config/../vendor/rails/activerecord/ lib/../../activesupport/lib/active_support/dependencies.rb:452:in`const\_missing’  
from ./script/…/config/…/config/…/vendor/rails/activerecord/  
lib/…/…/activesupport/lib/active\_support/dependencies.rb:464:in  
`const_missing' from ./script/../config/../config/../app/models/forum.rb:9 from ./script/../config/../config/../vendor/rails/activerecord/ lib/../../activesupport/lib/active_support/dependencies.rb:203:in`load\_without\_new\_constant\_marking’  
from ./script/…/config/…/config/…/vendor/rails/activerecord/  
lib/…/…/activesupport/lib/active\_support/dependencies.rb:203:in  
`load_file' from ./script/../config/../config/../vendor/rails/activerecord/ lib/../../activesupport/lib/active_support/dependencies.rb:342:in`new\_constants\_in’  
from ./script/…/config/…/config/…/vendor/rails/activerecord/  
lib/…/…/activesupport/lib/active\_support/dependencies.rb:202:in  
`load_file' from ./script/../config/../config/../vendor/rails/activerecord/ lib/../../activesupport/lib/active_support/dependencies.rb:94:in`require\_or\_load’  
from ./script/…/config/…/config/…/vendor/rails/activerecord/  
lib/…/…/activesupport/lib/active\_support/dependencies.rb:248:in  
`load_missing_constant' from ./script/../config/../config/../vendor/rails/activerecord/ lib/../../activesupport/lib/active_support/dependencies.rb:452:in`const\_missing’  
from ./script/…/config/…/config/…/vendor/rails/activerecord/  
lib/…/…/activesupport/lib/active\_support/dependencies.rb:464:in  
`const\_missing’  
from (irb):2

Any idea?

Martin

---

<div class="post-metadata">

**Author:** ![linus1412](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e68b1a/32.png) [@linus1412](https://www.ruby-forum.com/u/linus1412)\
**Post date:** [May 31, 2007, 5:28pm UTC](https://www.ruby-forum.com/t/activeresource-with-rails-1-2-x/105606/7 "2007-05-31T17:28:33Z")

</div>

If Edge is out of the question, then it’s not too difficult of a  
process.  
What I did was put activeresource under vendor, then in my  
environment.rb:

config.load\_paths += %w( #{RAILS\_ROOT}/vendor/activeresource/lib )

and let Rails do the rest.

Jason

---

<div class="post-metadata">

**Author:** ![linus1412](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e68b1a/32.png) [@linus1412](https://www.ruby-forum.com/u/linus1412)\
**Post date:** [May 31, 2007, 6:15pm UTC](https://www.ruby-forum.com/t/activeresource-with-rails-1-2-x/105606/8 "2007-05-31T18:15:39Z")

</div>

On 5/31/07, linus1412 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi Jason,
> 
> I tried what you suggested, but when I try to create one of my ARes  
> objects in the console I get:
> 
> f = Forum.new  
> NameError: uninitialized constant ActiveResource

You need to require ‘active\_resource’

–  
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:** ![linus1412](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e68b1a/32.png) [@linus1412](https://www.ruby-forum.com/u/linus1412)\
**Post date:** [May 31, 2007, 6:26pm UTC](https://www.ruby-forum.com/t/activeresource-with-rails-1-2-x/105606/9 "2007-05-31T18:26:40Z")

</div>

Yeah!

Thanks for your help guys!

Martin Smith

> **[SquadFootball.com is for sale | HugeDomains](https://www.hugedomains.com/domain_profile.cfm?d=squadfootball.com)**
>
> Painless, quick delivery of your domain name. Fast and professional service.
