Howdy, I had an application perfect for ActiveResource, which I do realize is not finished. Anyway, I froze my app to edge and then defined a class: class Address < ActiveResource::Base self.site = "http://ws.geonames.org/findNearestAddress?lat=:lat&lng=:long" End I tried to use it from the console but I get the trace below. It appears it can''t ''see'' ActiveResource. What am I doing wrong? Thanks, Hunter>> @location.addressNameError: uninitialized constant ActiveResource from ./script/../config/../config/../vendor/rails/activerecord/lib/../../activesu pport/lib/active_support/dependencies.rb:237:in `load_missing_constant'' from ./script/../config/../config/../vendor/rails/activerecord/lib/../../activesu pport/lib/active_support/dependencies.rb:315:in `const_missing'' from ./script/../config/../config/../vendor/rails/activerecord/lib/../../activesu pport/lib/active_support/dependencies.rb:322:in `const_missing'' from ./script/../config/../config/../app/models/address.rb:1 from ./script/../config/../config/../vendor/rails/activerecord/lib/../../activesu pport/lib/active_support/dependencies.rb:343:in `load'' from ./script/../config/../config/../vendor/rails/activerecord/lib/../../activesu pport/lib/active_support/dependencies.rb:183:in `load_file'' from ./script/../config/../config/../vendor/rails/activerecord/lib/../../activesu pport/lib/active_support/dependencies.rb:85:in `require_or_load'' from ./script/../config/../config/../vendor/rails/activerecord/lib/../../activesu pport/lib/active_support/dependencies.rb:219:in `load_missing_constant'' from ./script/../config/../config/../vendor/rails/activerecord/lib/../../activesu pport/lib/active_support/dependencies.rb:315:in `const_missing'' from ./script/../config/../config/../vendor/rails/activerecord/lib/../../activesu pport/lib/active_support/dependencies.rb:322:in `const_missing'' from ./script/../config/../config/../vendor/rails/activerecord/lib/../../activesu pport/lib/active_support/dependencies.rb:328:in `const_missing'' from ./script/../config/../config/../app/models/location.rb:8:in `address'' from (irb):2 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On 9/1/06, HH <lists-HAWAbpnI61OZ1JSuHaJ1sQC/G2K4zDHf@public.gmane.org> wrote:> > Howdy, > > I had an application perfect for ActiveResource, which I do realize is not > finished. > > Anyway, I froze my app to edge and then defined a class: > > class Address < ActiveResource::Base > self.site = "http://ws.geonames.org/findNearestAddress?lat=:lat&lng=:long" > End > > I tried to use it from the console but I get the trace below. > > It appears it can''t ''see'' ActiveResource. > > What am I doing wrong?active resource isn''t a part of rails right now, so you''ll have to specifically require it in environment.rb. -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Thanks. I tried that by doing this: config.load_paths += %W( #{RAILS_ROOT}/vendor/rails/activeresource/lib ) I am still getting the same error after restarting the server. Is there another way to require it? I got this method from Gooooogle.> From: Rick Olson <technoweenie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > Reply-To: <rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > Date: Fri, 1 Sep 2006 03:06:25 -0500 > To: <rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > Subject: [Rails] Re: Uninitialized constant w/ ActiveResource > >> Howdy, >> >> I had an application perfect for ActiveResource, which I do realize is not >> finished. >> >> Anyway, I froze my app to edge and then defined a class: >> >> class Address < ActiveResource::Base >> self.site = "http://ws.geonames.org/findNearestAddress?lat=:lat&lng=:long" >> End >> >> I tried to use it from the console but I get the trace below. >> >> It appears it can''t ''see'' ActiveResource. >> >> What am I doing wrong? > > active resource isn''t a part of rails right now, so you''ll have to > specifically require it in environment.rb.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---