In the past, whenever I’ve spoken to a group about ActiveResource, one of the questions that regularly comes up is if ActiveResource is available as a gem. Trying to install it from the svn tree is a little less than straight forward. With ARes now scheduled to be a part of Rails it will be installable as a gem. For now, though, prior to the official Rails release you can get ARes installed with:
gem install activeresource --source http://gems.rubyonrails.org |
(Thanks to DHH for pointing this out in my last post)
When Rails is released you will be able to use the more conventional:
gem install activeresource |
tags: ruby, rubyonrails, REST

Awesome!
I’m really looking forward to using this. I’ve got an app that this is perfect for.
Do I have to be using Edge (or any specific version of Rails) on the client side to install ARes? Are there any dependencies on ActiveSupport or everething it needs is installed by the gem?
Great news. Thanks!
Okada – if you’re installing the gems, ActiveResource and ActiveSupport are the only ones you should need to install (and trying a
gem install activeresourcewill automatically pull down the dependencies for you).As far as needing to be on edge Rails on the client side – I’m not sure about that. I would guess that since the only potentially conflicting dependency is ActiveSupport you might be in the clear?
Hello everybody
I’m trying to understand how to work with ActiveResource, but I cannot manage the installation. After gem install activeresource—source http://gems.rubyonrails.org I have now the gems activeresource (0.9.0.6552) activesupport (1.4.2.6552, 1.4.2.6548, 1.4.1, 1.3.1, 1.3.0, 1.2.5)
When I try to open the console (./script/console) into my application and then just inspect the ActiveResource, I have an error message: “NameError: uninitialized constant ActiveResource”
When I try with >> require ‘active_resource’ I have the following error message: “MissingSourceFile: no such file to load—active_resource”
What I have to include in order to make it run?
Thanks
I found the problem!
I was working with a project already started with Rails 1.2.2 then I just updated the gems.
Now I changed in config/environment.rb: RAILS_GEM_VERSION = ‘1.2.2’ to RAILS_GEM_VERSION = ‘1.2.3’. It seems work now.
Ops, the problem was not completely solved. With 1.2.3 I can start the script/console, but when I start the script/server (or event script/about) I have this error:
/opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2.6552/lib/active_support/core_ext/module/aliasing.rb:31:in `alias_method’: undefined method `load_plugin’ for class `Rails::Initializer’ (NameError)
Rails 1.2.2 with ActiveSupport 1.4.1 works fine, but when I want to have ActiveResource, I need at least 1.2.3 and 1.4.2 that don’t start in proper way.
I’ve played around with this some, and am curious if you actually got it working Franco. I’ve installed the beta gem which pulled down activesupport 1.4.2.6752. However, when trying to use things inside a rails 1.2.3 app, which ties specifically to activesupport 1.4.2, I get an activation error. Have you (or others) just hacked at things to get it working?
Why do I get this error when I try to install it? ERROR: While executing gem … (NoMethodError) undefined method `source_index’ for # /usr/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:81:in `source_index_hash’ /usr/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:80:in `each’ /usr/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:80:in `source_index_hash’ /usr/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:91:in `specs_n_sources_matching’ /usr/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:114:in `find_gem_to_install’ /usr/lib/ruby/site_ruby/1.8/rubygems/remote_installer.rb:57:in `install’ /usr/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:277:in `execute’ /usr/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:239:in `each’ /usr/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:239:in `execute’ /usr/lib/ruby/site_ruby/1.8/rubygems/command.rb:70:in `invoke’ /usr/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:120:in `process_args’ /usr/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:91:in `run’ /usr/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:30:in `run’ /usr/bin/gem:23
(sudo rm /usr/lib/ruby/gems/1.8/source_cache doesn’t help)
Thanks
Thanks Ryan.
I was trying to run my tests and kept getting “no such file to load—active_resource”.
After running “gem install activeresource—source http://gems.rubyonrails.org” the problem was fixed!
Thanks for the tip. I wasn’t able to build a new rails project due to missing activeresource. Found your blog and fixed it!
Thanks for the tip. I wasn’t able to build a new rails project due to missing activeresource. Found your blog and fixed it!
Its like you learn my thoughts! You appear to understand a lot about this, like you wrote the e book in it or something. I believe that you could do with some percent to pressure the message house a little bit, however instead of that, this is magnificent blog. An excellent read. I’ll definitely be back.
Appreciation to my father who told me on the topic of this blog, this website is in fact awesome.
Thanks to my father who told me concerning this webpage, this web site is genuinely awesome.